@@ -159,7 +159,7 @@ impl<'schema> ::std::convert::From<&'schema graphql_parser::schema::Document> fo
159159 }
160160 schema:: TypeDefinition :: Union ( union) => {
161161 let variants: BTreeSet < & str > =
162- union. types . iter ( ) . map ( |s| s . as_str ( ) ) . collect ( ) ;
162+ union. types . iter ( ) . map ( String :: as_str) . collect ( ) ;
163163 schema. unions . insert (
164164 & union. name ,
165165 GqlUnion {
@@ -173,12 +173,12 @@ impl<'schema> ::std::convert::From<&'schema graphql_parser::schema::Document> fo
173173 schema:: TypeDefinition :: Interface ( interface) => {
174174 let mut iface = GqlInterface :: new (
175175 & interface. name ,
176- interface. description . as_ref ( ) . map ( |d| d . as_str ( ) ) ,
176+ interface. description . as_ref ( ) . map ( String :: as_str) ,
177177 ) ;
178178 iface
179179 . fields
180180 . 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) ,
182182 name : f. name . as_str ( ) ,
183183 type_ : FieldType :: from ( & f. field_type ) ,
184184 deprecation : DeprecationStatus :: Current ,
@@ -192,9 +192,9 @@ impl<'schema> ::std::convert::From<&'schema graphql_parser::schema::Document> fo
192192 schema:: Definition :: DirectiveDefinition ( _) => ( ) ,
193193 schema:: Definition :: TypeExtension ( _extension) => ( ) ,
194194 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) ;
198198 }
199199 }
200200 }
@@ -224,17 +224,17 @@ impl<'schema> ::std::convert::From<&'schema crate::introspection_response::Intro
224224 . query_type
225225 . as_ref ( )
226226 . and_then ( |ty| ty. name . as_ref ( ) )
227- . map ( |s| s . as_str ( ) ) ;
227+ . map ( String :: as_str) ;
228228 schema. mutation_type = root
229229 . mutation_type
230230 . as_ref ( )
231231 . and_then ( |ty| ty. name . as_ref ( ) )
232- . map ( |s| s . as_str ( ) ) ;
232+ . map ( String :: as_str) ;
233233 schema. subscription_type = root
234234 . subscription_type
235235 . as_ref ( )
236236 . and_then ( |ty| ty. name . as_ref ( ) )
237- . map ( |s| s . as_str ( ) ) ;
237+ . map ( String :: as_str) ;
238238
239239 // Holds which objects implement which interfaces so we can populate GqlInterface#implemented_by later.
240240 // It maps interface names to a vec of implementation names.
@@ -320,7 +320,7 @@ impl<'schema> ::std::convert::From<&'schema crate::introspection_response::Intro
320320 . map ( Vec :: as_slice)
321321 . unwrap_or_else ( || & [ ] )
322322 . iter ( )
323- . filter_map ( |t| t . as_ref ( ) )
323+ . filter_map ( Option :: as_ref)
324324 . map ( |t| & t. type_ref . name )
325325 {
326326 interface_implementations
@@ -340,7 +340,7 @@ impl<'schema> ::std::convert::From<&'schema crate::introspection_response::Intro
340340 }
341341 Some ( __TypeKind:: INTERFACE ) => {
342342 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) ) ;
344344 iface. fields . extend (
345345 ty. fields
346346 . as_ref ( )
0 commit comments