From 29a7559fe37194f80a9243dabee7f103cba01bfb Mon Sep 17 00:00:00 2001 From: Boiethios <Boiethios@users.noreply.github.com> Date: Tue, 1 Jun 2021 22:27:30 +0200 Subject: [PATCH] Update WeakBoundedVec's remove and swap_remove (#8985) Co-authored-by: Boiethios <felix-dev@daudre-vignier.fr> --- substrate/frame/support/src/storage/weak_bounded_vec.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/substrate/frame/support/src/storage/weak_bounded_vec.rs b/substrate/frame/support/src/storage/weak_bounded_vec.rs index 606c24de44b..ca2271df434 100644 --- a/substrate/frame/support/src/storage/weak_bounded_vec.rs +++ b/substrate/frame/support/src/storage/weak_bounded_vec.rs @@ -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`]. -- GitLab