aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-03-15 16:06:50 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-23 10:25:39 +0100
commit077dd1cde95debb41a6cd153407e17e48ceb71bf (patch)
treeb2b32f578cd00a57b87cca830210271775a66a9c /src/model
parent2d13f0aa13e10289104f858f3cc833e43ebd45d6 (diff)
downloadgarage-077dd1cde95debb41a6cd153407e17e48ceb71bf.tar.gz
garage-077dd1cde95debb41a6cd153407e17e48ceb71bf.zip
Clippy
Diffstat (limited to 'src/model')
-rw-r--r--src/model/block_ref_table.rs3
-rw-r--r--src/model/garage.rs7
2 files changed, 5 insertions, 5 deletions
diff --git a/src/model/block_ref_table.rs b/src/model/block_ref_table.rs
index 0ab3d7e8..b6945403 100644
--- a/src/model/block_ref_table.rs
+++ b/src/model/block_ref_table.rs
@@ -52,7 +52,8 @@ impl TableSchema for BlockRefTable {
type Filter = DeletedFilter;
fn updated(&self, old: Option<Self::E>, new: Option<Self::E>) {
- let block = &old.as_ref().or_else(|| new.as_ref()).unwrap().block;
+ #[allow(clippy::or_fun_call)]
+ let block = &old.as_ref().or(new.as_ref()).unwrap().block;
let was_before = old.as_ref().map(|x| !x.deleted.get()).unwrap_or(false);
let is_after = new.as_ref().map(|x| !x.deleted.get()).unwrap_or(false);
if is_after && !was_before {
diff --git a/src/model/garage.rs b/src/model/garage.rs
index cbceeb64..abdb920a 100644
--- a/src/model/garage.rs
+++ b/src/model/garage.rs
@@ -142,7 +142,8 @@ impl Garage {
let key_table = Table::new(KeyTable, control_rep_param, system.clone(), &db);
info!("Initialize Garage...");
- let garage = Arc::new(Self {
+
+ Arc::new(Self {
config,
db,
background,
@@ -154,9 +155,7 @@ impl Garage {
object_table,
version_table,
block_ref_table,
- });
-
- garage
+ })
}
pub fn bucket_helper(&self) -> helper::bucket::BucketHelper {