diff --git a/src/chunk.rs b/src/chunk.rs index 2361677..28e5a78 100644 --- a/src/chunk.rs +++ b/src/chunk.rs @@ -366,7 +366,7 @@ impl Compiler { self.libraries_with_known_members.push(lib.clone()); } self.library_constants - .get_or_insert_with(HashMap::new) + .get_or_insert_default() .insert((lib, member), r#const.into()); self } @@ -666,7 +666,7 @@ impl Chunk<'_> { && self.detect_mode() == ChunkMode::Text { #[cfg(feature = "luau")] - if let Ok(data) = self.compiler.get_or_insert_with(Default::default).compile(source) { + if let Ok(data) = self.compiler.get_or_insert_default().compile(source) { self.source = Ok(Cow::Owned(data)); self.mode = Some(ChunkMode::Binary); } diff --git a/src/state/raw.rs b/src/state/raw.rs index d3bc70c..c6919a9 100644 --- a/src/state/raw.rs +++ b/src/state/raw.rs @@ -1126,7 +1126,7 @@ impl RawLua { #[cfg(feature = "luau")] if registry.enable_namecall { let map: &mut rustc_hash::FxHashMap<_, crate::types::CallbackPtr> = - methods_map.get_or_insert_with(Default::default); + methods_map.get_or_insert_default(); for (k, m) in ®istry.methods { map.insert(k.as_bytes().to_vec(), &**m); }