Use namespace for ScriptFnDef.

This commit is contained in:
Stephen Chung
2021-03-07 22:10:54 +08:00
parent e87f981674
commit 330d3f87af
12 changed files with 106 additions and 108 deletions

View File

@@ -1212,7 +1212,7 @@ impl Dynamic {
},
)
}
_ => unreachable!("self should be Shared"),
_ => unreachable!(),
},
_ => (),
}
@@ -1684,6 +1684,16 @@ impl<T: Variant + Clone> From<&[T]> for Dynamic {
))
}
}
#[cfg(not(feature = "no_index"))]
impl<T: Variant + Clone> crate::stdlib::iter::FromIterator<T> for Dynamic {
#[inline(always)]
fn from_iter<X: IntoIterator<Item = T>>(iter: X) -> Self {
Self(Union::Array(
Box::new(iter.into_iter().map(Dynamic::from).collect()),
AccessMode::ReadWrite,
))
}
}
#[cfg(not(feature = "no_object"))]
impl<K: Into<ImmutableString>, T: Variant + Clone> From<crate::stdlib::collections::HashMap<K, T>>
for Dynamic