git.delta.rocks / unique-network / refs/commits / ae913530fe53

difftreelog

fix remove unneeded PhantomData

Daniel Shiposha2023-10-13parent: #a46c1bd.patch.diff
in: master

1 file changed

modifiedpallets/common/src/lib.rsdiffbeforeafterboth
875875
876enum LazyValueState<'a, T> {876enum LazyValueState<'a, T> {
877 Pending(Box<dyn FnOnce() -> T + 'a>),877 Pending(Box<dyn FnOnce() -> T + 'a>),
878 InProgress(PhantomData<sp_std::cell::Cell<T>>),878 InProgress,
879 Computed(T),879 Computed(T),
880}880}
881881
930 return;930 return;
931 }931 }
932932
933 match sp_std::mem::replace(&mut self.state, InProgress(PhantomData)) {933 match sp_std::mem::replace(&mut self.state, InProgress) {
934 Pending(f) => self.state = Computed(f()),934 Pending(f) => self.state = Computed(f()),
935 _ => {935 _ => panic!("recursion isn't supported"),
936 // Computed is ruled out by the above condition
937 // InProgress is ruled out by not implementing Sync and absence of recursion
938 unreachable!()
939 }
940 }936 }
941 }937 }
942}938}