From da9681369e392fb419e666ee070d7d0274cd94d7 Mon Sep 17 00:00:00 2001 From: Cameron Pickett Date: Mon, 8 Jul 2024 16:25:38 -0700 Subject: [PATCH] Use BTreeMap for determinism --- src/expand.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/expand.rs b/src/expand.rs index 3b146f8..98cba51 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -9,7 +9,7 @@ use syn::{ TypeParamBound, TypePath, WhereClause, WherePredicate, }; -use std::collections::HashMap; +use std::collections::BTreeMap; pub(crate) fn derive(input: &DeriveInput) -> Result { let impls = match &input.data { @@ -224,9 +224,9 @@ fn add_display_constraint_to_type_predicate( fn extract_trait_constraints_from_source( where_clause: &WhereClause, type_params: &[&TypeParam], -) -> HashMap> { +) -> BTreeMap> { // Add trait bounds provided at the declaration site of type parameters for the struct/enum. - let mut param_constraint_mapping: HashMap> = type_params + let mut param_constraint_mapping: BTreeMap> = type_params .iter() .map(|type_param| { let trait_bounds: Vec = type_param