@@ -1633,9 +1633,9 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
16331633 // Returns a for(k,v)
16341634 spanned ( Statement :: ForKeyValue ( Box :: new ( ForKeyValueStatement {
16351635 var_type : Some ( var_type. expect ( "/" ) ) ,
1636- key : key . into ( ) ,
1636+ key,
16371637 key_input_type,
1638- value : value . into ( ) ,
1638+ value,
16391639 in_list : Some ( * rhs) , // We'll assume the rhs of [v in x] is a list. Any other case, DM will catch anyway.
16401640 block : require ! ( self . block( & LoopContext :: ForLoop ) ) ,
16411641 } ) ) )
@@ -1707,7 +1707,7 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
17071707 require ! ( self . exact( Token :: Punct ( Punctuation :: RParen ) ) ) ;
17081708 return spanned ( Statement :: ForList ( Box :: new ( ForListStatement {
17091709 var_type : None ,
1710- name : name . into ( ) ,
1710+ name,
17111711 input_type : None ,
17121712 in_list : Some ( rhs) ,
17131713 block : require ! ( self . block( & LoopContext :: ForList ) ) ,
@@ -1743,7 +1743,7 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
17431743 require ! ( self . exact( Token :: Punct ( Punctuation :: RParen ) ) ) ;
17441744 spanned ( Statement :: ForList ( Box :: new ( ForListStatement {
17451745 var_type,
1746- name : name . into ( ) ,
1746+ name,
17471747 input_type,
17481748 in_list,
17491749 block : require ! ( self . block( & LoopContext :: ForList ) ) ,
@@ -1834,11 +1834,7 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
18341834 } ;
18351835 let value = require ! ( self . expression( ) ) ;
18361836 require ! ( self . statement_terminator( ) ) ;
1837- spanned ( Statement :: Setting {
1838- name : name. into ( ) ,
1839- mode,
1840- value,
1841- } )
1837+ spanned ( Statement :: Setting { name, mode, value } )
18421838 } else if let Some ( ( ) ) = self . exact_ident ( "break" ) ? {
18431839 let label = self . ident ( ) ?;
18441840 require ! ( self . statement_terminator( ) ) ;
@@ -2037,7 +2033,7 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
20372033 // {...}
20382034 success ( Statement :: ForRange ( Box :: new ( ForRangeStatement {
20392035 var_type,
2040- name : name . into ( ) ,
2036+ name,
20412037 start,
20422038 end,
20432039 step,
@@ -2139,7 +2135,7 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
21392135 let key = require ! ( this. ident( ) ) ;
21402136 require ! ( this. exact( Token :: Punct ( Punctuation :: Assign ) ) ) ;
21412137 let value = require ! ( this. expression( ) ) ;
2142- vars. push ( ( key. into ( ) , value) ) ;
2138+ vars. push ( ( key, value) ) ;
21432139 SUCCESS
21442140 } ,
21452141 ) ?;
@@ -2406,7 +2402,7 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
24062402 }
24072403 Term :: NewMiniExpr {
24082404 expr: Box :: new( MiniExpr {
2409- ident: ident . into ( ) ,
2405+ ident,
24102406 fields: fields. into_boxed_slice( ) ,
24112407 } ) ,
24122408 args: self . arguments( & [ ] , & ident!( "New" ) ) ?,
@@ -2549,7 +2545,7 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
25492545 match self . arguments( & [ ] , & i) ? {
25502546 Some ( args) => {
25512547 self . annotate_precise( start..first_token, || Annotation :: UnscopedCall ( i. clone( ) ) ) ;
2552- Term :: Call ( i. into ( ) , args)
2548+ Term :: Call ( i, args)
25532549 } ,
25542550 None => {
25552551 belongs_to. push( i. clone( ) ) ;
@@ -2588,9 +2584,9 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
25882584 Token :: Punct ( Punctuation :: Scope ) => {
25892585 if let Some ( ident) = self . ident( ) ? {
25902586 if let Some ( args) = self . arguments( & [ ] , & ident!( "::" ) ) ? {
2591- Term :: GlobalCall ( Ident :: from ( ident) , args)
2587+ Term :: GlobalCall ( ident, args)
25922588 } else {
2593- Term :: GlobalIdent ( Ident :: from ( ident) )
2589+ Term :: GlobalIdent ( ident)
25942590 }
25952591 } else {
25962592 // Go away
@@ -2711,8 +2707,8 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
27112707 } ) ;
27122708 }
27132709 match kind {
2714- PropertyAccessKind :: Scope => Follow :: ProcReference ( ident. into ( ) ) ,
2715- _ => Follow :: Call ( kind, ident. into ( ) , args) ,
2710+ PropertyAccessKind :: Scope => Follow :: ProcReference ( ident) ,
2711+ _ => Follow :: Call ( kind, ident, args) ,
27162712 }
27172713 } ,
27182714 None => {
@@ -2723,8 +2719,8 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
27232719 belongs_to. push ( ident. clone ( ) ) ;
27242720 }
27252721 match kind {
2726- PropertyAccessKind :: Scope => Follow :: StaticField ( ident. into ( ) ) ,
2727- _ => Follow :: Field ( kind, ident. into ( ) ) ,
2722+ PropertyAccessKind :: Scope => Follow :: StaticField ( ident) ,
2723+ _ => Follow :: Field ( kind, ident) ,
27282724 }
27292725 } ,
27302726 } ;
@@ -2766,10 +2762,7 @@ impl<'ctx, 'an, 'inp> Parser<'ctx, 'an, 'inp> {
27662762 } ) ;
27672763 belongs_to. push ( ident. clone ( ) ) ;
27682764 }
2769- success ( Field {
2770- kind,
2771- ident : ident. into ( ) ,
2772- } )
2765+ success ( Field { kind, ident } )
27732766 }
27742767
27752768 /// a parenthesized, comma-separated list of expressions
0 commit comments