btreeset.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. diff --git a/uniffi_bindgen/src/interface/types.rs b/uniffi_bindgen/src/interface/types.rs
  2. index 6448d58..b7efd22 100644
  3. --- a/uniffi_bindgen/src/interface/types.rs
  4. +++ b/uniffi_bindgen/src/interface/types.rs
  5. @@ -26,7 +26,7 @@
  6. use anyhow::bail;
  7. use anyhow::Result;
  8. use std::convert::TryFrom;
  9. -use std::{collections::hash_map::Entry, collections::HashMap, collections::HashSet};
  10. +use std::{collections::hash_map::Entry, collections::HashMap, collections::BTreeSet};
  11. use super::Attributes;
  12. @@ -71,7 +71,7 @@ pub enum FFIType {
  13. /// Represents all the different high-level types that can be used in a component interface.
  14. /// At this level we identify user-defined types by name, without knowing any details
  15. /// of their internal structure apart from what type of thing they are (record, enum, etc).
  16. -#[derive(Debug, Clone, Eq, PartialEq, Hash)]
  17. +#[derive(Debug, Clone, Eq, PartialEq, Hash, PartialOrd, Ord)]
  18. pub enum Type {
  19. // Primitive types.
  20. UInt8,
  21. @@ -195,7 +195,7 @@ pub(crate) struct TypeUniverse {
  22. // Named type definitions (including aliases).
  23. type_definitions: HashMap<String, Type>,
  24. // All the types in the universe, by canonical type name.
  25. - all_known_types: HashSet<Type>,
  26. + all_known_types: BTreeSet<Type>,
  27. }
  28. impl TypeUniverse {