aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-21 19:52:30 +0100
committerMartin Fischer <martin@push-f.com>2021-11-21 19:54:46 +0100
commit0dd8413eca378e5dc2e6cbdc6f9c6f8bde604e4a (patch)
treee191baf60e478ed040c6a865cb7676f3465860b4 /src/lib.rs
parent23fcd4ef079ad2b4aed69b4f363cbb9e7102c4ed (diff)
support boxed Iterator in Option
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index fc81e42..1f75023 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -390,9 +390,9 @@ impl TypeTransform {
let inner = opt.convert(quote!(x));
quote! {#arg.map(|x| #inner)}
}
- TypeTransform::Iterator(inner) => {
+ TypeTransform::Iterator(box_type, inner) => {
let inner = inner.convert(quote!(x));
- quote! {Box::new(#arg.map(|x| #inner))}
+ quote! {Box::new(#arg.map(|x| #inner)) as #box_type}
}
TypeTransform::Result(ok, err) => {
let map_ok = !matches!(ok.as_ref(), TypeTransform::NoOp);