replace Option CRDT by explicit CancelingOption and MergingOption types

This commit is contained in:
Alex Auvolat
2026-05-04 19:51:35 +02:00
parent eb37a3e11a
commit bf0a24ea69
20 changed files with 237 additions and 133 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ use crate::xml::to_xml_with_header;
pub async fn handle_get_cors(ctx: ReqCtx) -> Result<Response<ResBody>, Error> {
let ReqCtx { bucket_params, .. } = ctx;
if let Some(cors) = bucket_params.cors_config.get() {
if let Some(cors) = bucket_params.cors_config.get().inner() {
let wc = CorsConfiguration {
xmlns: (),
cors_rules: cors
@@ -38,7 +38,7 @@ pub async fn handle_delete_cors(ctx: ReqCtx) -> Result<Response<ResBody>, Error>
mut bucket_params,
..
} = ctx;
bucket_params.cors_config.update(None);
bucket_params.cors_config.update(None.into());
garage
.bucket_table
.insert(&Bucket::present(bucket_id, bucket_params))
@@ -67,7 +67,7 @@ pub async fn handle_put_cors(
bucket_params
.cors_config
.update(Some(conf.into_garage_cors_config()?));
.update(Some(conf.into_garage_cors_config()?).into());
garage
.bucket_table
.insert(&Bucket::present(bucket_id, bucket_params))