From d1dc2e825fe874967b8d03297fbb3d1e207cedf5 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 10 Apr 2024 16:00:08 +0100 Subject: [PATCH 1/2] Swap BianryHeap for KeyedVec to avoid Ord constraint issue --- codegen/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index ac95e57da1..a0980edb3c 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -348,7 +348,7 @@ fn default_derives(crate_path: &syn::Path) -> DerivesRegistry { fn default_substitutes(crate_path: &syn::Path) -> TypeSubstitutes { let mut type_substitutes = TypeSubstitutes::new(); - let defaults: [(syn::Path, syn::Path); 11] = [ + let defaults: [(syn::Path, syn::Path); 12] = [ ( parse_quote!(bitvec::order::Lsb0), parse_quote!(#crate_path::utils::bits::Lsb0), @@ -389,6 +389,10 @@ fn default_substitutes(crate_path: &syn::Path) -> TypeSubstitutes { parse_quote!(BTreeMap), parse_quote!(#crate_path::utils::KeyedVec), ), + ( + parse_quote!(BinaryHeap), + parse_quote!(#crate_path::utils::KeyedVec), + ), ( parse_quote!(BTreeSet), parse_quote!(#crate_path::alloc::vec::Vec), From fe2ef892900fb477be94e0043f40de3de7e42205 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 10 Apr 2024 16:59:29 +0100 Subject: [PATCH 2/2] Vec, not KeyedVec --- codegen/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index a0980edb3c..41feda0e7f 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -391,7 +391,7 @@ fn default_substitutes(crate_path: &syn::Path) -> TypeSubstitutes { ), ( parse_quote!(BinaryHeap), - parse_quote!(#crate_path::utils::KeyedVec), + parse_quote!(#crate_path::alloc::vec::Vec), ), ( parse_quote!(BTreeSet),