@@ -159,7 +159,7 @@ impl<'schema> ::std::convert::From<&'schema graphql_parser::schema::Document> fo
159
159
}
160
160
schema:: TypeDefinition :: Union ( union) => {
161
161
let variants: BTreeSet < & str > =
162
- union. types . iter ( ) . map ( |s| s . as_str ( ) ) . collect ( ) ;
162
+ union. types . iter ( ) . map ( String :: as_str) . collect ( ) ;
163
163
schema. unions . insert (
164
164
& union. name ,
165
165
GqlUnion {
@@ -173,12 +173,12 @@ impl<'schema> ::std::convert::From<&'schema graphql_parser::schema::Document> fo
173
173
schema:: TypeDefinition :: Interface ( interface) => {
174
174
let mut iface = GqlInterface :: new (
175
175
& interface. name ,
176
- interface. description . as_ref ( ) . map ( |d| d . as_str ( ) ) ,
176
+ interface. description . as_ref ( ) . map ( String :: as_str) ,
177
177
) ;
178
178
iface
179
179
. fields
180
180
. extend ( interface. fields . iter ( ) . map ( |f| GqlObjectField {
181
- description : f. description . as_ref ( ) . map ( |s| s . as_str ( ) ) ,
181
+ description : f. description . as_ref ( ) . map ( String :: as_str) ,
182
182
name : f. name . as_str ( ) ,
183
183
type_ : FieldType :: from ( & f. field_type ) ,
184
184
deprecation : DeprecationStatus :: Current ,
@@ -192,9 +192,9 @@ impl<'schema> ::std::convert::From<&'schema graphql_parser::schema::Document> fo
192
192
schema:: Definition :: DirectiveDefinition ( _) => ( ) ,
193
193
schema:: Definition :: TypeExtension ( _extension) => ( ) ,
194
194
schema:: Definition :: SchemaDefinition ( definition) => {
195
- schema. query_type = definition. query . as_ref ( ) . map ( |s| s . as_str ( ) ) ;
196
- schema. mutation_type = definition. mutation . as_ref ( ) . map ( |s| s . as_str ( ) ) ;
197
- schema. subscription_type = definition. subscription . as_ref ( ) . map ( |s| s . as_str ( ) ) ;
195
+ schema. query_type = definition. query . as_ref ( ) . map ( String :: as_str) ;
196
+ schema. mutation_type = definition. mutation . as_ref ( ) . map ( String :: as_str) ;
197
+ schema. subscription_type = definition. subscription . as_ref ( ) . map ( String :: as_str) ;
198
198
}
199
199
}
200
200
}
@@ -224,17 +224,17 @@ impl<'schema> ::std::convert::From<&'schema crate::introspection_response::Intro
224
224
. query_type
225
225
. as_ref ( )
226
226
. and_then ( |ty| ty. name . as_ref ( ) )
227
- . map ( |s| s . as_str ( ) ) ;
227
+ . map ( String :: as_str) ;
228
228
schema. mutation_type = root
229
229
. mutation_type
230
230
. as_ref ( )
231
231
. and_then ( |ty| ty. name . as_ref ( ) )
232
- . map ( |s| s . as_str ( ) ) ;
232
+ . map ( String :: as_str) ;
233
233
schema. subscription_type = root
234
234
. subscription_type
235
235
. as_ref ( )
236
236
. and_then ( |ty| ty. name . as_ref ( ) )
237
- . map ( |s| s . as_str ( ) ) ;
237
+ . map ( String :: as_str) ;
238
238
239
239
// Holds which objects implement which interfaces so we can populate GqlInterface#implemented_by later.
240
240
// It maps interface names to a vec of implementation names.
@@ -320,7 +320,7 @@ impl<'schema> ::std::convert::From<&'schema crate::introspection_response::Intro
320
320
. map ( Vec :: as_slice)
321
321
. unwrap_or_else ( || & [ ] )
322
322
. iter ( )
323
- . filter_map ( |t| t . as_ref ( ) )
323
+ . filter_map ( Option :: as_ref)
324
324
. map ( |t| & t. type_ref . name )
325
325
{
326
326
interface_implementations
@@ -340,7 +340,7 @@ impl<'schema> ::std::convert::From<&'schema crate::introspection_response::Intro
340
340
}
341
341
Some ( __TypeKind:: INTERFACE ) => {
342
342
let mut iface =
343
- GqlInterface :: new ( name, ty. description . as_ref ( ) . map ( |t| t . as_str ( ) ) ) ;
343
+ GqlInterface :: new ( name, ty. description . as_ref ( ) . map ( String :: as_str) ) ;
344
344
iface. fields . extend (
345
345
ty. fields
346
346
. as_ref ( )
0 commit comments