Replace get_or_insert_with with get_or_insert_default

This commit is contained in:
Alex Orlenko
2026-01-29 10:46:58 +00:00
parent d9c139b55f
commit c1ffd4e790
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -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 &registry.methods {
map.insert(k.as_bytes().to_vec(), &**m);
}