diff --git a/src/liballoc/tests/vec.rs b/src/liballoc/tests/vec.rs index bf4a31c72dd4..2a9bfefc713e 100644 --- a/src/liballoc/tests/vec.rs +++ b/src/liballoc/tests/vec.rs @@ -133,13 +133,13 @@ fn test_extend_ref() { #[test] fn test_remove_item() { - let mut v = vec![1,2,3]; + let mut v = vec![1, 2, 3]; v.remove_item(&1); assert_eq!(v.len(), 2); - assert_eq!(v, [2,3]); + assert_eq!(v, [2, 3]); - let mut w = vec![1,2,3]; + let mut w = vec![1, 2, 3]; w.remove_item(&4); assert_eq!(w.len(), 3); diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 0825dc228d82..9b48c21728ad 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1690,8 +1690,7 @@ impl Vec { } } -impl Vec { - +impl Vec { /// Removes the first instance of `item` from the vector if the item exists. /// /// # Examples @@ -1707,12 +1706,12 @@ impl Vec { #[unstable(feature = "vec_remove_item", reason = "recently added", issue = "40062")] pub fn remove_item(&mut self, item: &V) -> Option - where T: PartialEq + where + T: PartialEq, { let pos = self.iter().position(|x| *x == *item)?; Some(self.remove(pos)) } - } ////////////////////////////////////////////////////////////////////////////////