File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ impl Transformation {
195195 #( #entries) , *
196196 }
197197 } ;
198- let map_closure = if is_result {
198+ let map_closure = if self . is_nested_result ( ) {
199199 quote ! {
200200 |item| :: benzina:: __private:: std:: result:: Result :: Ok :: <
201201 #output_type,
@@ -269,13 +269,17 @@ impl Transformation {
269269
270270 fn is_result ( & self ) -> bool {
271271 match self . quantity {
272- Quantity :: AtLeastZero | Quantity :: AtLeastOne => true ,
273- _ => self . entries . iter ( ) . any ( |( _, entry) | match entry {
274- NestedOrNot :: Nested ( nested) => nested. is_result ( ) ,
275- NestedOrNot :: Not ( _) => false ,
276- } ) ,
272+ Quantity :: One | Quantity :: AssumeOne => true ,
273+ _ => self . is_nested_result ( ) ,
277274 }
278275 }
276+
277+ fn is_nested_result ( & self ) -> bool {
278+ self . entries . iter ( ) . any ( |( _, entry) | match entry {
279+ NestedOrNot :: Nested ( nested) => nested. is_result ( ) ,
280+ NestedOrNot :: Not ( _) => false ,
281+ } )
282+ }
279283}
280284
281285impl NoTransformation {
You can’t perform that action at this time.
0 commit comments