aboutsummaryrefslogtreecommitdiff
path: root/src/model/bucket_table.rs
diff options
context:
space:
mode:
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 {