mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-23 05:07:27 +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>,
|
Q: Query<DB>,
|
||||||
DB: Database,
|
DB: Database,
|
||||||
{
|
{
|
||||||
fn set(&self, db: &DB, key: &Q::Key, database_key: &DB::DatabaseKey, value: Q::Value) {
|
fn set(
|
||||||
self.set_common(db, key, database_key, value, Durability::LOW);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_with_durability(
|
|
||||||
&self,
|
&self,
|
||||||
db: &DB,
|
db: &DB,
|
||||||
key: &Q::Key,
|
key: &Q::Key,
|
||||||
|
|
12
src/lib.rs
12
src/lib.rs
|
@ -527,8 +527,7 @@ where
|
||||||
where
|
where
|
||||||
Q::Storage: plumbing::InputQueryStorageOps<DB, Q>,
|
Q::Storage: plumbing::InputQueryStorageOps<DB, Q>,
|
||||||
{
|
{
|
||||||
self.storage
|
self.set_with_durability(key, value, Durability::LOW);
|
||||||
.set(self.db, &key, &self.database_key(&key), value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Assign a value to an "input query", with the additional
|
/// Assign a value to an "input query", with the additional
|
||||||
|
@ -543,13 +542,8 @@ where
|
||||||
where
|
where
|
||||||
Q::Storage: plumbing::InputQueryStorageOps<DB, Q>,
|
Q::Storage: plumbing::InputQueryStorageOps<DB, Q>,
|
||||||
{
|
{
|
||||||
self.storage.set_with_durability(
|
self.storage
|
||||||
self.db,
|
.set(self.db, &key, &self.database_key(&key), value, durability);
|
||||||
&key,
|
|
||||||
&self.database_key(&key),
|
|
||||||
value,
|
|
||||||
durability,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the size of LRU cache of values for this query table.
|
/// Sets the size of LRU cache of values for this query table.
|
||||||
|
|
|
@ -165,9 +165,7 @@ where
|
||||||
DB: Database,
|
DB: Database,
|
||||||
Q: Query<DB>,
|
Q: Query<DB>,
|
||||||
{
|
{
|
||||||
fn set(&self, db: &DB, key: &Q::Key, database_key: &DB::DatabaseKey, new_value: Q::Value);
|
fn set(
|
||||||
|
|
||||||
fn set_with_durability(
|
|
||||||
&self,
|
&self,
|
||||||
db: &DB,
|
db: &DB,
|
||||||
key: &Q::Key,
|
key: &Q::Key,
|
||||||
|
|
Loading…
Reference in a new issue