diff --git a/src/durability.rs b/src/durability.rs index a895de15..58a81e37 100644 --- a/src/durability.rs +++ b/src/durability.rs @@ -35,13 +35,14 @@ impl Durability { /// Example: the standard library or something from crates.io pub const HIGH: Durability = Durability(2); + /// The maximum possible durability; equivalent to HIGH but + /// "conceptually" distinct (i.e., if we add more durability + /// levels, this could change). + pub(crate) const MAX: Durability = Self::HIGH; + /// Number of durability levels. pub(crate) const LEN: usize = 3; - pub(crate) fn new(v: usize) -> Durability { - Durability(v as u8) - } - pub(crate) fn index(self) -> usize { self.0 as usize } diff --git a/src/runtime.rs b/src/runtime.rs index 2a26b4e1..f1a2a64f 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -159,11 +159,6 @@ where db.for_each_query(|query_storage| query_storage.sweep(db, strategy)); } - /// Returns the max durability, used for constants. - pub(crate) fn max_durability(&self) -> Durability { - Durability::new(self.shared_state.revisions.len() - 1) - } - /// The unique identifier attached to this `SalsaRuntime`. Each /// snapshotted runtime has a distinct identifier. #[inline] @@ -349,7 +344,7 @@ where }); // Push the active query onto the stack. - let max_durability = self.max_durability(); + let max_durability = Durability::MAX; let active_query = self.local_state.push_query(database_key, max_durability); // Execute user's code, accumulating inputs etc.