Skip to content

Commit

Permalink
Swap BinaryHeap for Vec to avoid Ord constraint issue (#1523)
Browse files Browse the repository at this point in the history
* Swap BianryHeap for KeyedVec to avoid Ord constraint issue

* Vec, not KeyedVec
  • Loading branch information
jsdw authored and niklasad1 committed Apr 11, 2024
1 parent 11aa5d3 commit c01c61e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,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),
Expand Down Expand Up @@ -387,7 +387,14 @@ fn default_substitutes(crate_path: &syn::Path) -> TypeSubstitutes {
parse_quote!(BTreeMap),
parse_quote!(#crate_path::utils::KeyedVec),
),
(parse_quote!(BTreeSet), parse_quote!(::std::vec::Vec)),
(
parse_quote!(BinaryHeap),
parse_quote!(::std::vec::Vec),
),
(
parse_quote!(BTreeSet),
parse_quote!(::std::vec::Vec),
),
// The `UncheckedExtrinsic(pub Vec<u8>)` is part of the runtime API calls.
// The inner bytes represent the encoded extrinsic, however when deriving the
// `EncodeAsType` the bytes would be re-encoded. This leads to the bytes
Expand Down

0 comments on commit c01c61e

Please sign in to comment.