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

@@ -18,7 +18,7 @@ where
{
lib.type_iterators.insert(
TypeId::of::<Range<T>>(),
Box::new(|source: Dynamic| {
Box::new(|source| {
Box::new(source.cast::<Range<T>>().map(|x| x.into_dynamic()))
as Box<dyn Iterator<Item = Dynamic>>
}),
@@ -58,7 +58,7 @@ where
{
lib.type_iterators.insert(
TypeId::of::<StepRange<T>>(),
Box::new(|source: Dynamic| {
Box::new(|source| {
Box::new(source.cast::<StepRange<T>>().map(|x| x.into_dynamic()))
as Box<dyn Iterator<Item = Dynamic>>
}),