Advertisement
sword_smith

pattern-matching-on-slice-from-vector

Apr 25th, 2021
1,677
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.24 KB | None | 0 0
  1.     fn normalize(self) {
  2.         loop {
  3.             match self.coefficients.as_slice() {
  4.                 [0, _] => {
  5.                     self.coefficients.remove(0);
  6.                 }
  7.                 a => break,
  8.             }
  9.         }
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement