mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 21:01:03 +00:00
Fix lazy initialisation bug for parametizability (#2046)
remove lazy and compute prefix at compile time
This commit is contained in:
@@ -64,21 +64,6 @@ pub use runtime_io::print;
|
||||
#[doc(inline)]
|
||||
pub use srml_support_procedural::decl_storage;
|
||||
|
||||
pub mod lazy {
|
||||
use spin::Once;
|
||||
|
||||
pub struct Lazy<T: Sync>(Once<T>);
|
||||
|
||||
impl <T: Sync> Lazy<T> {
|
||||
pub const INIT: Self = Lazy(Once::INIT);
|
||||
|
||||
#[inline(always)]
|
||||
pub fn get<F>(&'static self, builder: F) -> &T where F: FnOnce() -> T {
|
||||
self.0.call_once(builder)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! fail {
|
||||
( $y:expr ) => {{
|
||||
|
||||
Reference in New Issue
Block a user