From ee57dd922b9c396298473b41e4046c8d00ee77d5 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 16 Jan 2024 16:28:17 +0100 Subject: Bump version to 0.9.1 --- src/model/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/model') diff --git a/src/model/Cargo.toml b/src/model/Cargo.toml index 42b7ffdb..8ecd5d63 100644 --- a/src/model/Cargo.toml +++ b/src/model/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "garage_model" -version = "0.9.0" +version = "0.9.1" authors = ["Alex Auvolat "] edition = "2018" license = "AGPL-3.0" -- cgit v1.2.3 From fe1af5d98b8e6c87f39f1d94586e61bff100e7d2 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 5 Feb 2024 13:02:02 +0100 Subject: [dep-upgrade-202402] refactor dependencies: move all as workspace deps --- src/model/Cargo.toml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/model') diff --git a/src/model/Cargo.toml b/src/model/Cargo.toml index 8ecd5d63..d4a1a711 100644 --- a/src/model/Cargo.toml +++ b/src/model/Cargo.toml @@ -20,26 +20,26 @@ garage_table.workspace = true garage_block.workspace = true garage_util.workspace = true -async-trait = "0.1.7" -arc-swap = "1.0" -blake2 = "0.10" -chrono = "0.4" -err-derive = "0.3" -hex = "0.4" -base64 = "0.21" -tracing = "0.1" -rand = "0.8" -zstd = { version = "0.12", default-features = false } - -serde = { version = "1.0", default-features = false, features = ["derive", "rc"] } -serde_bytes = "0.11" - -futures = "0.3" -futures-util = "0.3" -tokio = { version = "1.0", default-features = false, features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs"] } -opentelemetry = "0.17" - -netapp = "0.10" +async-trait.workspace = true +arc-swap.workspace = true +blake2.workspace = true +chrono.workspace = true +err-derive.workspace = true +hex.workspace = true +base64.workspace = true +tracing.workspace = true +rand.workspace = true +zstd.workspace = true + +serde.workspace = true +serde_bytes.workspace = true + +futures.workspace = true +futures-util.workspace = true +tokio.workspace = true +opentelemetry.workspace = true + +netapp.workspace = true [features] default = [ "sled", "lmdb", "sqlite" ] -- cgit v1.2.3 From ad5ce968d212d951f7459c36bcbdd78ce39be585 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 8 Feb 2024 18:57:18 +0100 Subject: [dep-upgrade-202402] remove useless mut --- src/model/helper/bucket.rs | 14 +++++++------- src/model/index_counter.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/model') diff --git a/src/model/helper/bucket.rs b/src/model/helper/bucket.rs index 576d03f3..e9842a91 100644 --- a/src/model/helper/bucket.rs +++ b/src/model/helper/bucket.rs @@ -126,7 +126,7 @@ impl<'a> BucketHelper<'a> { } // Checks ok, add alias - let mut bucket_p = bucket.state.as_option_mut().unwrap(); + let bucket_p = bucket.state.as_option_mut().unwrap(); let alias_ts = increment_logical_clock_2( bucket_p.aliases.get_timestamp(alias_name), @@ -163,7 +163,7 @@ impl<'a> BucketHelper<'a> { alias_name: &String, ) -> Result<(), Error> { let mut bucket = self.get_existing_bucket(bucket_id).await?; - let mut bucket_state = bucket.state.as_option_mut().unwrap(); + let bucket_state = bucket.state.as_option_mut().unwrap(); let mut alias = self .0 @@ -245,7 +245,7 @@ impl<'a> BucketHelper<'a> { self.0.bucket_alias_table.insert(&alias).await?; } - if let Some(mut bucket_state) = bucket.state.as_option_mut() { + if let Some(bucket_state) = bucket.state.as_option_mut() { bucket_state.aliases = LwwMap::raw_item(alias_name.clone(), alias_ts, false); self.0.bucket_table.insert(&bucket).await?; } @@ -274,7 +274,7 @@ impl<'a> BucketHelper<'a> { let mut bucket = self.get_existing_bucket(bucket_id).await?; let mut key = key_helper.get_existing_key(key_id).await?; - let mut key_param = key.state.as_option_mut().unwrap(); + let key_param = key.state.as_option_mut().unwrap(); if let Some(Some(existing_alias)) = key_param.local_aliases.get(alias_name) { if *existing_alias != bucket_id { @@ -283,7 +283,7 @@ impl<'a> BucketHelper<'a> { } // Checks ok, add alias - let mut bucket_p = bucket.state.as_option_mut().unwrap(); + let bucket_p = bucket.state.as_option_mut().unwrap(); let bucket_p_local_alias_key = (key.key_id.clone(), alias_name.clone()); // Calculate the timestamp to assign to this aliasing in the two local_aliases maps @@ -326,7 +326,7 @@ impl<'a> BucketHelper<'a> { let mut bucket = self.get_existing_bucket(bucket_id).await?; let mut key = key_helper.get_existing_key(key_id).await?; - let mut bucket_p = bucket.state.as_option_mut().unwrap(); + let bucket_p = bucket.state.as_option_mut().unwrap(); if key .state @@ -359,7 +359,7 @@ impl<'a> BucketHelper<'a> { } // Checks ok, remove alias - let mut key_param = key.state.as_option_mut().unwrap(); + let key_param = key.state.as_option_mut().unwrap(); let bucket_p_local_alias_key = (key.key_id.clone(), alias_name.clone()); let alias_ts = increment_logical_clock_2( diff --git a/src/model/index_counter.rs b/src/model/index_counter.rs index a46c165f..c0bf38d8 100644 --- a/src/model/index_counter.rs +++ b/src/model/index_counter.rs @@ -232,7 +232,7 @@ impl IndexCounter { let now = now_msec(); for (s, inc) in counts.iter() { - let mut ent = entry.values.entry(s.to_string()).or_insert((0, 0)); + let ent = entry.values.entry(s.to_string()).or_insert((0, 0)); ent.0 = std::cmp::max(ent.0 + 1, now); ent.1 += *inc; } @@ -348,7 +348,7 @@ impl IndexCounter { }, }; for (s, v) in counts.iter() { - let mut tv = local_counter.values.entry(s.to_string()).or_insert((0, 0)); + let tv = local_counter.values.entry(s.to_string()).or_insert((0, 0)); tv.0 = std::cmp::max(tv.0 + 1, now); tv.1 += v; } -- cgit v1.2.3