diff --git a/crates/lune-roblox/src/datatypes/types/cframe.rs b/crates/lune-roblox/src/datatypes/types/cframe.rs index adb8d88..6c9cfa9 100644 --- a/crates/lune-roblox/src/datatypes/types/cframe.rs +++ b/crates/lune-roblox/src/datatypes/types/cframe.rs @@ -323,7 +323,7 @@ impl LuaUserData for CFrame { } else if let Ok(vec) = ud.borrow::() { return lua.create_userdata(*this * *vec); } - }; + } Err(LuaError::FromLuaConversionError { from: rhs.type_name(), to: "userdata", diff --git a/crates/lune-roblox/src/instance/mod.rs b/crates/lune-roblox/src/instance/mod.rs index 59bf929..0746a16 100644 --- a/crates/lune-roblox/src/instance/mod.rs +++ b/crates/lune-roblox/src/instance/mod.rs @@ -4,11 +4,10 @@ use std::{ collections::{BTreeMap, VecDeque}, fmt, hash::{Hash, Hasher}, - sync::Mutex, + sync::{LazyLock, Mutex}, }; use mlua::prelude::*; -use once_cell::sync::Lazy; use rbx_dom_weak::{ types::{Attributes as DomAttributes, Ref as DomRef, Variant as DomValue}, ustr, Instance as DomInstance, InstanceBuilder as DomInstanceBuilder, Ustr, WeakDom, @@ -31,8 +30,8 @@ pub mod registry; const PROPERTY_NAME_ATTRIBUTES: &str = "Attributes"; const PROPERTY_NAME_TAGS: &str = "Tags"; -static INTERNAL_DOM: Lazy> = - Lazy::new(|| Mutex::new(WeakDom::new(DomInstanceBuilder::new("ROOT")))); +static INTERNAL_DOM: LazyLock> = + LazyLock::new(|| Mutex::new(WeakDom::new(DomInstanceBuilder::new("ROOT")))); #[derive(Debug, Clone, Copy)] pub struct Instance { @@ -694,8 +693,7 @@ impl Instance { predicate callback and a breadth-first search. ### See Also - * [`FindFirstDescendant`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstDescendant) - on the Roblox Developer Hub + * [`FindFirstDescendant`](https://create.roblox.com/docs/reference/engine/classes/Instance#FindFirstDescendant) on the Roblox Developer Hub */ pub fn find_descendant(&self, predicate: F) -> Option where diff --git a/crates/lune-roblox/src/shared/userdata.rs b/crates/lune-roblox/src/shared/userdata.rs index d197600..204d45a 100644 --- a/crates/lune-roblox/src/shared/userdata.rs +++ b/crates/lune-roblox/src/shared/userdata.rs @@ -87,7 +87,7 @@ where } } _ => {} - }; + } Err(LuaError::FromLuaConversionError { from: rhs.type_name(), to: type_name::(), @@ -112,7 +112,7 @@ where } } _ => {} - }; + } Err(LuaError::FromLuaConversionError { from: rhs.type_name(), to: type_name::(), @@ -137,7 +137,7 @@ where } } _ => {} - }; + } Err(LuaError::FromLuaConversionError { from: rhs.type_name(), to: type_name::(), @@ -168,7 +168,7 @@ where } } _ => {} - }; + } Err(LuaError::FromLuaConversionError { from: rhs.type_name(), to: type_name::(), @@ -193,7 +193,7 @@ where } } _ => {} - }; + } Err(LuaError::FromLuaConversionError { from: rhs.type_name(), to: type_name::(), diff --git a/crates/lune-std-datetime/src/values.rs b/crates/lune-std-datetime/src/values.rs index e270bfa..6028507 100644 --- a/crates/lune-std-datetime/src/values.rs +++ b/crates/lune-std-datetime/src/values.rs @@ -76,7 +76,7 @@ impl FromLua<'_> for DateTimeValues { to: "DateTimeValues", message: Some("value must be a table".to_string()), }); - }; + } let value = value.as_table().unwrap(); let values = Self { diff --git a/crates/lune-std-process/src/options/mod.rs b/crates/lune-std-process/src/options/mod.rs index 8ef8be0..be685bc 100644 --- a/crates/lune-std-process/src/options/mod.rs +++ b/crates/lune-std-process/src/options/mod.rs @@ -62,7 +62,7 @@ impl<'lua> FromLua<'lua> for ProcessSpawnOptions { return Err(LuaError::runtime( "Invalid value for option 'cwd' - path does not exist", )); - }; + } this.cwd = Some(cwd); } value => { diff --git a/crates/lune-std-stdio/src/prompt.rs b/crates/lune-std-stdio/src/prompt.rs index a893544..8a72510 100644 --- a/crates/lune-std-stdio/src/prompt.rs +++ b/crates/lune-std-stdio/src/prompt.rs @@ -192,7 +192,7 @@ pub fn prompt(options: PromptOptions) -> LuaResult { let mut prompt = Confirm::with_theme(&theme); if let Some(b) = options.default_bool { prompt = prompt.default(b); - }; + } let result = prompt .with_prompt(options.text.expect("Missing text in prompt options")) .interact() diff --git a/crates/lune-std/src/globals/require/context.rs b/crates/lune-std/src/globals/require/context.rs index 3734b6c..b919a40 100644 --- a/crates/lune-std/src/globals/require/context.rs +++ b/crates/lune-std/src/globals/require/context.rs @@ -266,7 +266,7 @@ impl RequireContext { Ok(LuaMultiValue::from_vec(multi_vec)) } }; - }; + } let result = library.module(lua); diff --git a/crates/lune-utils/src/fmt/error/components.rs b/crates/lune-utils/src/fmt/error/components.rs index 32459c5..c6333e6 100644 --- a/crates/lune-utils/src/fmt/error/components.rs +++ b/crates/lune-utils/src/fmt/error/components.rs @@ -1,14 +1,15 @@ -use std::fmt; -use std::str::FromStr; -use std::sync::Arc; +use std::{ + fmt, + str::FromStr, + sync::{Arc, LazyLock}, +}; use console::style; use mlua::prelude::*; -use once_cell::sync::Lazy; use super::StackTrace; -static STYLED_STACK_BEGIN: Lazy = Lazy::new(|| { +static STYLED_STACK_BEGIN: LazyLock = LazyLock::new(|| { format!( "{}{}{}", style("[").dim(), @@ -17,7 +18,7 @@ static STYLED_STACK_BEGIN: Lazy = Lazy::new(|| { ) }); -static STYLED_STACK_END: Lazy = Lazy::new(|| { +static STYLED_STACK_END: LazyLock = LazyLock::new(|| { format!( "{}{}{}", style("[").dim(), diff --git a/crates/lune-utils/src/fmt/value/mod.rs b/crates/lune-utils/src/fmt/value/mod.rs index bd29f55..931b687 100644 --- a/crates/lune-utils/src/fmt/value/mod.rs +++ b/crates/lune-utils/src/fmt/value/mod.rs @@ -1,8 +1,10 @@ -use std::{collections::HashSet, sync::Arc}; +use std::{ + collections::HashSet, + sync::{Arc, LazyLock}, +}; use console::{colors_enabled as get_colors_enabled, set_colors_enabled}; use mlua::prelude::*; -use once_cell::sync::Lazy; use parking_lot::ReentrantMutex; mod basic; @@ -18,7 +20,8 @@ pub use self::config::ValueFormatConfig; // NOTE: Since the setting for colors being enabled is global, // and these functions may be called in parallel, we use this global // lock to make sure that we don't mess up the colors for other threads. -static COLORS_LOCK: Lazy>> = Lazy::new(|| Arc::new(ReentrantMutex::new(()))); +static COLORS_LOCK: LazyLock>> = + LazyLock::new(|| Arc::new(ReentrantMutex::new(()))); /** Formats a Lua value into a pretty string using the given config. diff --git a/crates/lune-utils/src/fmt/value/style.rs b/crates/lune-utils/src/fmt/value/style.rs index 0a4dbe4..1e58c22 100644 --- a/crates/lune-utils/src/fmt/value/style.rs +++ b/crates/lune-utils/src/fmt/value/style.rs @@ -1,9 +1,10 @@ +use std::sync::LazyLock; + use console::Style; -use once_cell::sync::Lazy; -pub static COLOR_GREEN: Lazy