about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authordylan_DPC <dylan.dpc@gmail.com>2020-01-04 23:57:34 +0530
committerdylan_DPC <dylan.dpc@gmail.com>2020-01-04 23:57:34 +0530
commitf744ea03b46e860decb8672dc032805cbf9df652 (patch)
treecba6e066eaa8cd663ab8fde3be35b83baa244af0 /src
parenteb36688a01f0a51db53f6f830472f03836e4cf68 (diff)
downloadrust-f744ea03b46e860decb8672dc032805cbf9df652.tar.gz
rust-f744ea03b46e860decb8672dc032805cbf9df652.zip
ef em ti ... :P
Diffstat (limited to 'src')
-rw-r--r--src/liballoc/tests/vec.rs6
-rw-r--r--src/liballoc/vec.rs7
2 files changed, 6 insertions, 7 deletions
diff --git a/src/liballoc/tests/vec.rs b/src/liballoc/tests/vec.rs
index bf4a31c72dd..2a9bfefc713 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 0825dc228d8..9b48c21728a 100644
--- a/src/liballoc/vec.rs
+++ b/src/liballoc/vec.rs
@@ -1690,8 +1690,7 @@ impl<T: PartialEq> Vec<T> {
     }
 }
 
-impl <T> Vec<T> {
-
+impl<T> Vec<T> {
     /// Removes the first instance of `item` from the vector if the item exists.
     ///
     /// # Examples
@@ -1707,12 +1706,12 @@ impl <T> Vec<T> {
 
     #[unstable(feature = "vec_remove_item", reason = "recently added", issue = "40062")]
     pub fn remove_item<V>(&mut self, item: &V) -> Option<T>
-    where T: PartialEq<V>
+    where
+        T: PartialEq<V>,
     {
         let pos = self.iter().position(|x| *x == *item)?;
         Some(self.remove(pos))
     }
-
 }
 
 ////////////////////////////////////////////////////////////////////////////////