File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -1046,10 +1046,8 @@ pub(crate) mod parsing {
10461046 let mut params = Punctuated :: new ( ) ;
10471047 loop {
10481048 let lookahead = input. lookahead1 ( ) ;
1049- params. push_value ( if lookahead. peek ( Lifetime ) {
1050- input. parse ( ) . map ( CapturedParam :: Lifetime ) ?
1051- } else if lookahead. peek ( Ident ) {
1052- input. parse ( ) . map ( CapturedParam :: Ident ) ?
1049+ params. push_value ( if lookahead. peek ( Lifetime ) || lookahead. peek ( Ident ) {
1050+ input. parse :: < CapturedParam > ( ) ?
10531051 } else if lookahead. peek ( Token ! [ >] ) {
10541052 break ;
10551053 } else {
@@ -1073,6 +1071,21 @@ pub(crate) mod parsing {
10731071 } )
10741072 }
10751073 }
1074+
1075+ #[ cfg( feature = "full" ) ]
1076+ #[ cfg_attr( docsrs, doc( cfg( feature = "parsing" ) ) ) ]
1077+ impl Parse for CapturedParam {
1078+ fn parse ( input : ParseStream ) -> Result < Self > {
1079+ let lookahead = input. lookahead1 ( ) ;
1080+ if lookahead. peek ( Lifetime ) {
1081+ input. parse ( ) . map ( CapturedParam :: Lifetime )
1082+ } else if lookahead. peek ( Ident ) {
1083+ input. parse ( ) . map ( CapturedParam :: Ident )
1084+ } else {
1085+ Err ( lookahead. error ( ) )
1086+ }
1087+ }
1088+ }
10761089}
10771090
10781091#[ cfg( feature = "printing" ) ]
You can’t perform that action at this time.
0 commit comments