mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-22 21:05:11 +00:00
merge set and set_with_durability in plumbing trait
This commit is contained in:
parent
8d30df0a0f
commit
06ad8c7930
3 changed files with 5 additions and 17 deletions
|
@ -189,11 +189,7 @@ where
|
|||
Q: Query<DB>,
|
||||
DB: Database,
|
||||
{
|
||||
fn set(&self, db: &DB, key: &Q::Key, database_key: &DB::DatabaseKey, value: Q::Value) {
|
||||
self.set_common(db, key, database_key, value, Durability::LOW);
|
||||
}
|
||||
|
||||
fn set_with_durability(
|
||||
fn set(
|
||||
&self,
|
||||
db: &DB,
|
||||
key: &Q::Key,
|
||||
|
|
12
src/lib.rs
12
src/lib.rs
|
@ -527,8 +527,7 @@ where
|
|||
where
|
||||
Q::Storage: plumbing::InputQueryStorageOps<DB, Q>,
|
||||
{
|
||||
self.storage
|
||||
.set(self.db, &key, &self.database_key(&key), value);
|
||||
self.set_with_durability(key, value, Durability::LOW);
|
||||
}
|
||||
|
||||
/// Assign a value to an "input query", with the additional
|
||||
|
@ -543,13 +542,8 @@ where
|
|||
where
|
||||
Q::Storage: plumbing::InputQueryStorageOps<DB, Q>,
|
||||
{
|
||||
self.storage.set_with_durability(
|
||||
self.db,
|
||||
&key,
|
||||
&self.database_key(&key),
|
||||
value,
|
||||
durability,
|
||||
);
|
||||
self.storage
|
||||
.set(self.db, &key, &self.database_key(&key), value, durability);
|
||||
}
|
||||
|
||||
/// Sets the size of LRU cache of values for this query table.
|
||||
|
|
|
@ -165,9 +165,7 @@ where
|
|||
DB: Database,
|
||||
Q: Query<DB>,
|
||||
{
|
||||
fn set(&self, db: &DB, key: &Q::Key, database_key: &DB::DatabaseKey, new_value: Q::Value);
|
||||
|
||||
fn set_with_durability(
|
||||
fn set(
|
||||
&self,
|
||||
db: &DB,
|
||||
key: &Q::Key,
|
||||
|
|
Loading…
Reference in a new issue