@@ -9,7 +9,7 @@ use crate::static_graphql::{
9
9
pub fn collect_fields < ' a > (
10
10
selection_set : & query:: SelectionSet ,
11
11
parent_type : & schema:: TypeDefinition ,
12
- known_fragments : & HashMap < String , query:: FragmentDefinition > ,
12
+ known_fragments : & HashMap < & str , & query:: FragmentDefinition > ,
13
13
context : & ' a OperationVisitorContext < ' a > ,
14
14
) -> HashMap < String , Vec < query:: Field > > {
15
15
let mut map = HashMap :: new ( ) ;
@@ -36,7 +36,7 @@ fn does_fragment_condition_match<'a>(
36
36
if let Some ( conditional_type) = context. schema . type_by_name ( type_name) {
37
37
if conditional_type
38
38
. name ( )
39
- . eq ( & current_selection_set_type. name ( ) )
39
+ . eq ( current_selection_set_type. name ( ) )
40
40
{
41
41
return true ;
42
42
}
@@ -63,7 +63,7 @@ fn does_fragment_condition_match<'a>(
63
63
fn collect_fields_inner < ' a > (
64
64
selection_set : & query:: SelectionSet ,
65
65
parent_type : & schema:: TypeDefinition ,
66
- known_fragments : & HashMap < String , query:: FragmentDefinition > ,
66
+ known_fragments : & HashMap < & str , & query:: FragmentDefinition > ,
67
67
context : & ' a OperationVisitorContext < ' a > ,
68
68
result_arr : & mut HashMap < String , Vec < query:: Field > > ,
69
69
visited_fragments_names : & mut Vec < String > ,
@@ -93,7 +93,7 @@ fn collect_fields_inner<'a>(
93
93
{
94
94
visited_fragments_names. push ( f. fragment_name . clone ( ) ) ;
95
95
96
- if let Some ( fragment) = known_fragments. get ( & f. fragment_name ) {
96
+ if let Some ( fragment) = known_fragments. get ( f. fragment_name . as_str ( ) ) {
97
97
if does_fragment_condition_match (
98
98
& Some ( fragment. type_condition . clone ( ) ) ,
99
99
& parent_type,
0 commit comments