File tree Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ mod polyfill {
255
255
}
256
256
257
257
thread_local ! {
258
- static ENTERED_ENTRY_POINT : Cell <usize > = Cell :: new( 0 ) ;
258
+ static ENTERED_ENTRY_POINT : Cell <usize > = const { Cell :: new( 0 ) } ;
259
259
}
260
260
261
261
/// This is the entry point for a macro to support [`Diagnostic`]s.
@@ -312,7 +312,7 @@ mod polyfill {
312
312
}
313
313
314
314
thread_local ! {
315
- static ERR_STORAGE : RefCell <Vec <Diagnostic >> = RefCell :: new( Vec :: new( ) ) ;
315
+ static ERR_STORAGE : RefCell <Vec <Diagnostic >> = const { RefCell :: new( Vec :: new( ) ) } ;
316
316
}
317
317
318
318
/// Emits the provided [`Diagnostic`], while not aborting macro execution.
Original file line number Diff line number Diff line change @@ -450,14 +450,14 @@ enum Field {
450
450
Named ( syn:: Field ) ,
451
451
452
452
/// Unnamed [`Field`].
453
- Unnamed ( syn :: Field ) ,
453
+ Unnamed ,
454
454
}
455
455
456
456
impl ToTokens for Field {
457
457
fn to_tokens ( & self , tokens : & mut TokenStream ) {
458
458
match self {
459
459
Self :: Named ( f) => f. ident . to_tokens ( tokens) ,
460
- Self :: Unnamed ( _ ) => tokens. append ( Literal :: u8_unsuffixed ( 0 ) ) ,
460
+ Self :: Unnamed => tokens. append ( Literal :: u8_unsuffixed ( 0 ) ) ,
461
461
}
462
462
}
463
463
}
@@ -470,9 +470,7 @@ impl TryFrom<syn::Fields> for Field {
470
470
syn:: Fields :: Named ( mut f) if f. named . len ( ) == 1 => {
471
471
Ok ( Self :: Named ( f. named . pop ( ) . unwrap ( ) . into_value ( ) ) )
472
472
}
473
- syn:: Fields :: Unnamed ( mut f) if f. unnamed . len ( ) == 1 => {
474
- Ok ( Self :: Unnamed ( f. unnamed . pop ( ) . unwrap ( ) . into_value ( ) ) )
475
- }
473
+ syn:: Fields :: Unnamed ( f) if f. unnamed . len ( ) == 1 => Ok ( Self :: Unnamed ) ,
476
474
_ => Err ( ERR . custom_error ( value. span ( ) , "expected exactly 1 field" ) ) ,
477
475
}
478
476
}
@@ -483,7 +481,7 @@ impl Field {
483
481
fn match_arg ( & self ) -> TokenStream {
484
482
match self {
485
483
Self :: Named ( _) => quote ! { { #self : v } } ,
486
- Self :: Unnamed ( _ ) => quote ! { ( v) } ,
484
+ Self :: Unnamed => quote ! { ( v) } ,
487
485
}
488
486
}
489
487
}
Original file line number Diff line number Diff line change @@ -900,7 +900,7 @@ mod bounded_generic_scalar {
900
900
mod explicit_custom_context {
901
901
use super :: * ;
902
902
903
- struct CustomContext ( prelude:: String ) ;
903
+ struct CustomContext ( # [ allow ( dead_code ) ] prelude:: String ) ;
904
904
905
905
impl juniper:: Context for CustomContext { }
906
906
Original file line number Diff line number Diff line change @@ -1097,7 +1097,7 @@ mod external_resolver_enum_variant {
1097
1097
enum Character {
1098
1098
A ( Human ) ,
1099
1099
#[ graphql( with = Character :: as_droid) ]
1100
- B ( Droid ) ,
1100
+ B ( # [ allow ( dead_code ) ] Droid ) ,
1101
1101
}
1102
1102
1103
1103
impl Character {
You can’t perform that action at this time.
0 commit comments