diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-16 17:14:48 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-16 17:14:48 +0100 |
| commit | ce2b34851d38dc28d6ffbbb4fe563e226acb7445 (patch) | |
| tree | 04ea331b4549df0d1a0b62e854d65f14137f528c /common | |
| parent | 30e13399fa9f815cd1884fe87914cdb22d1985af (diff) | |
| download | jellything-ce2b34851d38dc28d6ffbbb4fe563e226acb7445.tar jellything-ce2b34851d38dc28d6ffbbb4fe563e226acb7445.tar.bz2 jellything-ce2b34851d38dc28d6ffbbb4fe563e226acb7445.tar.zst | |
finish refactoring import crate
Diffstat (limited to 'common')
| -rw-r--r-- | common/object/src/lib.rs | 10 | ||||
| -rw-r--r-- | common/src/lib.rs | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/common/object/src/lib.rs b/common/object/src/lib.rs index 290cf91..5637dd6 100644 --- a/common/object/src/lib.rs +++ b/common/object/src/lib.rs @@ -17,7 +17,11 @@ pub use path::*; pub use registry::*; pub use value::*; -use std::{collections::HashSet, hash::Hash, marker::PhantomData}; +use std::{ + collections::{BTreeSet, HashSet}, + hash::Hash, + marker::PhantomData, +}; #[repr(transparent)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] @@ -150,7 +154,7 @@ impl<'a> Object<'a> { } } #[must_use] - pub fn extend<T: Value<'a> + Hash + Eq + PartialEq>( + pub fn extend<T: Value<'a> + Eq + Ord>( &self, tag: TypedTag<T>, values: impl IntoIterator<Item = T>, @@ -160,7 +164,7 @@ impl<'a> Object<'a> { &self .iter(tag) .chain(values) - .collect::<HashSet<_>>() + .collect::<BTreeSet<_>>() .into_iter() .collect::<Vec<_>>(), ) diff --git a/common/src/lib.rs b/common/src/lib.rs index cc11c58..e5531f4 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -19,7 +19,7 @@ pub static TAGREG: LazyLock<Registry> = LazyLock::new(|| { }); fields! { - // Tag counter: 38 + // Tag counter: 39 NO_KIND: Tag = 1 "kind"; NO_TITLE: &str = 2 "title"; @@ -40,6 +40,7 @@ fields! { NO_VISIBILITY: Tag = 14 "visibility"; NO_STORAGE_SIZE: u64 = 15 "storage_size"; NO_CREDIT: Object = 33 "credit"; // multi + NO_SLUG: &str = 37 "slug"; CR_NODE: u64 = 34 "node"; CR_KIND: Tag = 35 "kind"; |