From 3678edd3555eb956d1dd6cd9c33ba76011d5b91a Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 11 Mar 2026 17:11:26 +0300 Subject: [PATCH] meta: prefer std's `OnceLock` and `LazyLock` over once_cell Signed-off-by: NotAShelf Change-Id: I35d51abfa9a790206391dca891799d956a6a6964 --- .clippy.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.clippy.toml b/.clippy.toml index 20d3251..0a3de0a 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -6,3 +6,10 @@ await-holding-invalid-types = [ "dioxus_signals::WriteLock", { path = "dioxus_signals::WriteLock", reason = "Write should not be held over an await point. This will cause any reads or writes to fail while the await is pending since the write borrow is still active." }, ] + +disallowed-methods = [ + { path = "once_cell::unsync::OnceCell::get_or_init", reason = "use `std::cell::OnceCell` instead, unless you need get_or_try_init in which case #[expect] this lint" }, + { path = "once_cell::sync::OnceCell::get_or_init", reason = "use `std::sync::OnceLock` instead, unless you need get_or_try_init in which case #[expect] this lint" }, + { path = "once_cell::unsync::Lazy::new", reason = "use `std::cell::LazyCell` instead, unless you need into_value" }, + { path = "once_cell::sync::Lazy::new", reason = "use `std::sync::LazyLock` instead, unless you need into_value" }, +]