File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -707,31 +707,29 @@ fn match_meta_var(kind: &str, input: &mut TtIter) -> ExpandResult<Option<Fragmen
707
707
let tt_result = match kind {
708
708
"ident" => input
709
709
. expect_ident ( )
710
- . map ( |ident| Some ( tt:: Leaf :: from ( ident. clone ( ) ) . into ( ) ) )
710
+ . map ( |ident| tt:: Leaf :: from ( ident. clone ( ) ) . into ( ) )
711
711
. map_err ( |( ) | err ! ( "expected ident" ) ) ,
712
- "tt" => input. expect_tt ( ) . map ( Some ) . map_err ( |( ) | err ! ( ) ) ,
713
- "lifetime" => {
714
- input. expect_lifetime ( ) . map ( Some ) . map_err ( |( ) | err ! ( "expected lifetime" ) )
715
- }
712
+ "tt" => input. expect_tt ( ) . map_err ( |( ) | err ! ( ) ) ,
713
+ "lifetime" => input. expect_lifetime ( ) . map_err ( |( ) | err ! ( "expected lifetime" ) ) ,
716
714
"literal" => {
717
715
let neg = input. eat_char ( '-' ) ;
718
716
input
719
717
. expect_literal ( )
720
718
. map ( |literal| {
721
719
let lit = literal. clone ( ) ;
722
720
match neg {
723
- None => Some ( lit. into ( ) ) ,
724
- Some ( neg) => Some ( tt:: TokenTree :: Subtree ( tt:: Subtree {
721
+ None => lit. into ( ) ,
722
+ Some ( neg) => tt:: TokenTree :: Subtree ( tt:: Subtree {
725
723
delimiter : None ,
726
724
token_trees : vec ! [ neg, lit. into( ) ] ,
727
- } ) ) ,
725
+ } ) ,
728
726
}
729
727
} )
730
728
. map_err ( |( ) | err ! ( ) )
731
729
}
732
730
_ => Err ( ExpandError :: UnexpectedToken ) ,
733
731
} ;
734
- return tt_result. map ( |it| it . map ( Fragment :: Tokens ) ) . into ( ) ;
732
+ return tt_result. map ( |it| Some ( Fragment :: Tokens ( it ) ) ) . into ( ) ;
735
733
}
736
734
} ;
737
735
input. expect_fragment ( fragment) . map ( |it| it. map ( Fragment :: Tokens ) )
You can’t perform that action at this time.
0 commit comments