diff options
author | Nyaaori <+@nyaaori.cat> | 2022-12-21 10:42:12 +0100 |
---|---|---|
committer | Nyaaori <+@nyaaori.cat> | 2022-12-21 10:42:12 +0100 |
commit | c86313d4fa5b4d074e5ef40442a8a272d915dd3a (patch) | |
tree | f634689026ffc22ce82410de2da5dc792e4cfc08 /src/database | |
parent | 7b987411630056204b73e61165c8a99e20a78fec (diff) | |
download | conduit-c86313d4fa5b4d074e5ef40442a8a272d915dd3a.zip |
chore: code cleanup
https://rust-lang.github.io/rust-clippy/master/index.html#op_ref
https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/abstraction/sqlite.rs | 2 | ||||
-rw-r--r-- | src/database/mod.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/database/abstraction/sqlite.rs b/src/database/abstraction/sqlite.rs index af3e192..b69efb6 100644 --- a/src/database/abstraction/sqlite.rs +++ b/src/database/abstraction/sqlite.rs @@ -106,7 +106,7 @@ impl KeyValueDatabaseEngine for Arc<Engine> { } fn open_tree(&self, name: &str) -> Result<Arc<dyn KvTree>> { - self.write_lock().execute(&format!("CREATE TABLE IF NOT EXISTS {} ( \"key\" BLOB PRIMARY KEY, \"value\" BLOB NOT NULL )", name), [])?; + self.write_lock().execute(&format!("CREATE TABLE IF NOT EXISTS {name} ( \"key\" BLOB PRIMARY KEY, \"value\" BLOB NOT NULL )"), [])?; Ok(Arc::new(SqliteTable { engine: Arc::clone(self), diff --git a/src/database/mod.rs b/src/database/mod.rs index ebaa746..78bb358 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -827,7 +827,7 @@ impl KeyValueDatabase { let rule = rules_list.content.get(content_rule_transformation[0]); if rule.is_some() { let mut rule = rule.unwrap().clone(); - rule.rule_id = content_rule_transformation[1].to_string(); + rule.rule_id = content_rule_transformation[1].to_owned(); rules_list.content.remove(content_rule_transformation[0]); rules_list.content.insert(rule); } @@ -850,7 +850,7 @@ impl KeyValueDatabase { let rule = rules_list.underride.get(transformation[0]); if let Some(rule) = rule { let mut rule = rule.clone(); - rule.rule_id = transformation[1].to_string(); + rule.rule_id = transformation[1].to_owned(); rules_list.underride.remove(transformation[0]); rules_list.underride.insert(rule); } |