merge set and set_with_durability in plumbing trait

This commit is contained in:
Niko Matsakis 2019-07-05 06:01:17 -04:00
parent 8d30df0a0f
commit 06ad8c7930
3 changed files with 5 additions and 17 deletions

View file

@ -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,

View file

@ -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.

View file

@ -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,