aboutsummaryrefslogtreecommitdiff
path: root/src/model/bucket_table.rs
diff options
context:
space:
mode:
authorTrinity Pointard <trinity.pointard@gmail.com>2021-04-23 21:57:32 +0200
committerAlex Auvolat <alex@adnab.me>2021-05-03 22:11:41 +0200
commit4a1e079e8fe2c17078a274ef17c8d63e9b1bb96e (patch)
tree931ae67ad8f1fc22424c3e21394de188905a9586 /src/model/bucket_table.rs
parentf5a0cf0414fc3db7affcbe7ffcf4e251a2afd192 (diff)
downloadgarage-4a1e079e8fe2c17078a274ef17c8d63e9b1bb96e.tar.gz
garage-4a1e079e8fe2c17078a274ef17c8d63e9b1bb96e.zip
fix clippy warnings on model
Diffstat (limited to 'src/model/bucket_table.rs')
-rw-r--r--src/model/bucket_table.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/model/bucket_table.rs b/src/model/bucket_table.rs
index 69901b8d..9f89dccc 100644
--- a/src/model/bucket_table.rs
+++ b/src/model/bucket_table.rs
@@ -49,13 +49,6 @@ pub struct BucketParams {
pub website: crdt::LWW<bool>,
}
-impl CRDT for BucketParams {
- fn merge(&mut self, o: &Self) {
- self.authorized_keys.merge(&o.authorized_keys);
- self.website.merge(&o.website);
- }
-}
-
impl BucketParams {
/// Create an empty BucketParams with no authorized keys and no website accesss
pub fn new() -> Self {
@@ -66,6 +59,19 @@ impl BucketParams {
}
}
+impl CRDT for BucketParams {
+ fn merge(&mut self, o: &Self) {
+ self.authorized_keys.merge(&o.authorized_keys);
+ self.website.merge(&o.website);
+ }
+}
+
+impl Default for BucketParams {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Bucket {
/// Initializes a new instance of the Bucket struct
pub fn new(name: String) -> Self {