Fix bug with calling a pure function method-call style.

This commit is contained in:
Stephen Chung
2020-05-11 18:55:58 +08:00
parent 4a8710a4a9
commit 414f3d3c23
8 changed files with 221 additions and 115 deletions

View File

@@ -118,9 +118,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.cast::<Array>().into_iter())
as Box<dyn Iterator<Item = Dynamic>>
}),
Box::new(|arr| Box::new(
arr.cast::<Array>().into_iter()) as Box<dyn Iterator<Item = Dynamic>>
),
);
});