Update WeakBoundedVec's remove and swap_remove (#8985)

Co-authored-by: Boiethios <felix-dev@daudre-vignier.fr>
This commit is contained in:
Boiethios
2021-06-01 22:27:30 +02:00
committed by GitHub
parent e819fd03f9
commit 29a7559fe3
@@ -72,8 +72,8 @@ impl<T, S> WeakBoundedVec<T, S> {
/// # Panics
///
/// Panics if `index` is out of bounds.
pub fn remove(&mut self, index: usize) {
self.0.remove(index);
pub fn remove(&mut self, index: usize) -> T {
self.0.remove(index)
}
/// Exactly the same semantics as [`Vec::swap_remove`].
@@ -81,8 +81,8 @@ impl<T, S> WeakBoundedVec<T, S> {
/// # Panics
///
/// Panics if `index` is out of bounds.
pub fn swap_remove(&mut self, index: usize) {
self.0.swap_remove(index);
pub fn swap_remove(&mut self, index: usize) -> T {
self.0.swap_remove(index)
}
/// Exactly the same semantics as [`Vec::retain`].