Skip to content

Commit 8a02141

Browse files
authored
Changed return value to Option<T>
changed from Option<(usize, T)> to Option<T> as the index to the item removed is really unnecessary.
1 parent 3304e00 commit 8a02141

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcollections/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,13 +1298,13 @@ impl<T: PartialEq> Vec<T> {
12981298
}
12991299

13001300
#[unstable(feature = "vec_remove_item", reason = "recently added", issue = "38143")]
1301-
pub fn remove_item(&mut self, item: &T) -> Option<(usize, T)> {
1301+
pub fn remove_item(&mut self, item: &T) -> Option<T> {
13021302
let pos = match self.iter().position(|x| *x == *item) {
13031303
Some(x) => x,
13041304
None => return None,
13051305
};
13061306

1307-
Some((pos, self.remove(pos)))
1307+
Some(self.remove(pos))
13081308
}
13091309
}
13101310

0 commit comments

Comments
 (0)