From 06ad8c7930b176d928b600259354919d21cb192c Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 5 Jul 2019 06:01:17 -0400 Subject: [PATCH] merge set and set_with_durability in plumbing trait --- src/input.rs | 6 +----- src/lib.rs | 12 +++--------- src/plumbing.rs | 4 +--- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/input.rs b/src/input.rs index b7ef7fa5..87e5864e 100644 --- a/src/input.rs +++ b/src/input.rs @@ -189,11 +189,7 @@ where Q: Query, 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, diff --git a/src/lib.rs b/src/lib.rs index b5e563df..a9577fa3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -527,8 +527,7 @@ where where Q::Storage: plumbing::InputQueryStorageOps, { - 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, { - 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. diff --git a/src/plumbing.rs b/src/plumbing.rs index dab1fe5b..d4dd8bbf 100644 --- a/src/plumbing.rs +++ b/src/plumbing.rs @@ -165,9 +165,7 @@ where DB: Database, Q: Query, { - 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,