Upgrade Ruma to present. The following are intentionally benign for activation in a later commit: - Hydra backports not default. - Room version 12 not default. - Room version 12 not listed as stable. Do not enable them manually or you can brick your database. Signed-off-by: Jason Volk <jason@zemos.net>
18 lines
464 B
Rust
18 lines
464 B
Rust
use std::cmp::Ordering;
|
|
|
|
use ruma::events::StateEventType;
|
|
use smallstr::SmallString;
|
|
|
|
pub type TypeStateKey = (StateEventType, StateKey);
|
|
pub type StateKey = SmallString<[u8; INLINE_SIZE]>;
|
|
|
|
const INLINE_SIZE: usize = 48;
|
|
|
|
#[inline]
|
|
#[must_use]
|
|
pub fn cmp(a: &TypeStateKey, b: &TypeStateKey) -> Ordering { a.0.cmp(&b.0).then(a.1.cmp(&b.1)) }
|
|
|
|
#[inline]
|
|
#[must_use]
|
|
pub fn rcmp(a: &TypeStateKey, b: &TypeStateKey) -> Ordering { b.0.cmp(&a.0).then(b.1.cmp(&a.1)) }
|