From 4e1c34fa62f2db95044bc6972c8cdba556aabaf2 Mon Sep 17 00:00:00 2001 From: Sunli Date: Sat, 17 Jul 2021 10:13:42 +0800 Subject: [PATCH] Sort the types in the exported SDL by name. #577 --- src/registry/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/registry/mod.rs b/src/registry/mod.rs index a1a3e722..041fb936 100644 --- a/src/registry/mod.rs +++ b/src/registry/mod.rs @@ -2,7 +2,7 @@ mod cache_control; mod export_sdl; mod stringify_exec_doc; -use std::collections::{BTreeSet, HashMap, HashSet}; +use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::sync::Arc; use indexmap::map::IndexMap; @@ -338,7 +338,7 @@ pub struct MetaDirective { #[derive(Default)] pub struct Registry { - pub types: IndexMap, + pub types: BTreeMap, pub directives: HashMap, pub implements: HashMap>, pub query_type: String, @@ -618,7 +618,7 @@ impl Registry { let mut unused_types = BTreeSet::new(); fn traverse_field<'a>( - types: &'a IndexMap, + types: &'a BTreeMap, used_types: &mut BTreeSet<&'a str>, field: &'a MetaField, ) { @@ -633,7 +633,7 @@ impl Registry { } fn traverse_input_value<'a>( - types: &'a IndexMap, + types: &'a BTreeMap, used_types: &mut BTreeSet<&'a str>, input_value: &'a MetaInputValue, ) { @@ -645,7 +645,7 @@ impl Registry { } fn traverse_type<'a>( - types: &'a IndexMap, + types: &'a BTreeMap, used_types: &mut BTreeSet<&'a str>, type_name: &'a str, ) {