From 775693f36d96c304ff1cb76e0dea78d61d82903e Mon Sep 17 00:00:00 2001 From: Vika Date: Thu, 15 Jun 2023 22:45:28 +0300 Subject: Notes on how to replace lazy_static! with a LazyCell should've been a LazyLock tho --- kittybox-rs/src/database/redis/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kittybox-rs/src/database/redis') diff --git a/kittybox-rs/src/database/redis/mod.rs b/kittybox-rs/src/database/redis/mod.rs index eeaa3f2..39ee852 100644 --- a/kittybox-rs/src/database/redis/mod.rs +++ b/kittybox-rs/src/database/redis/mod.rs @@ -44,6 +44,12 @@ lazy_static! { edit_post: redis::Script::new(include_str!("./edit_post.lua")) }; } +/*#[cfg(feature(lazy_cell))] +static SCRIPTS_CELL: std::cell::LazyCell = std::cell::LazyCell::new(|| { + RedisScripts { + edit_post: redis::Script::new(include_str!("./edit_post.lua")) + } +});*/ #[derive(Clone)] pub struct RedisStorage { -- cgit 1.4.1