From fd6af7529aa79c3f4c1a5bc84b682a320c006ad2 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 03 Oct 2023 10:55:46 +0000 Subject: [PATCH] fix: force_value in LazyValue --- --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -888,18 +888,18 @@ /// Get the value. If it is called the first time, the value will be initialized. pub fn value(&mut self) -> &T { - self.compute_value_if_not_already(); + self.force_value(); self.value.as_ref().unwrap() } /// Get the value. If it is called the first time, the value will be initialized. pub fn value_mut(&mut self) -> &mut T { - self.compute_value_if_not_already(); + self.force_value(); self.value.as_mut().unwrap() } fn into_inner(mut self) -> T { - self.compute_value_if_not_already(); + self.force_value(); self.value.unwrap() } @@ -908,7 +908,7 @@ self.value.is_some() } - fn compute_value_if_not_already(&mut self) { + fn force_value(&mut self) { if self.value.is_none() { self.value = Some(self.f.take().unwrap()()) } -- gitstuff