Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update WeakBoundedVec's remove and swap_remove #8985

Merged
merged 1 commit into from
Jun 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions frame/support/src/storage/weak_bounded_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ 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`].
///
/// # 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`].
Expand Down