From e71020e3e613910e0315f558ead661b490a0ff20 Mon Sep 17 00:00:00 2001 From: Pawan Dhananjay Date: Tue, 3 Sep 2024 17:16:10 -0700 Subject: [PATCH] Fix take impl on RuntimeFixedList --- consensus/types/src/runtime_var_list.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/consensus/types/src/runtime_var_list.rs b/consensus/types/src/runtime_var_list.rs index 2bca5df2d9..b24be185da 100644 --- a/consensus/types/src/runtime_var_list.rs +++ b/consensus/types/src/runtime_var_list.rs @@ -253,7 +253,7 @@ pub struct RuntimeFixedList { len: usize, } -impl RuntimeFixedList { +impl RuntimeFixedList { pub fn new(vec: Vec) -> Self { let len = vec.len(); Self { vec, len } @@ -277,6 +277,7 @@ impl RuntimeFixedList { pub fn take(&mut self) -> Self { let new = std::mem::take(&mut self.vec); + *self = Self::new(vec![T::default(); self.len]); Self { vec: new, len: self.len,