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

Also fix BoundedVec remove API #8987

Merged
1 commit merged into from
Jun 2, 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/bounded_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ impl<T, S> BoundedVec<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