Avoid copying iterator sources.
This commit is contained in:
@@ -116,8 +116,8 @@ def_package!(crate:BasicArrayPackage:"Basic array utilities.", lib, {
|
||||
// Register array iterator
|
||||
lib.type_iterators.insert(
|
||||
TypeId::of::<Array>(),
|
||||
Box::new(|a: &Dynamic| {
|
||||
Box::new(a.downcast_ref::<Array>().unwrap().clone().into_iter())
|
||||
Box::new(|a: Dynamic| {
|
||||
Box::new(a.cast::<Array>().into_iter())
|
||||
as Box<dyn Iterator<Item = Dynamic>>
|
||||
}),
|
||||
);
|
||||
|
Reference in New Issue
Block a user