mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-02-03 18:47:53 +00:00
remove max_durability
in favor of Durability::MAX
This commit is contained in:
parent
e4cca9b8ff
commit
87f8517d75
2 changed files with 6 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue