lint: clippy rules or_fun_call (#2561)

Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
Tunglies
2026-04-15 19:48:39 -07:00
committed by GitHub
parent 1ffe23e10f
commit 579b124726
32 changed files with 109 additions and 85 deletions
@@ -1326,18 +1326,18 @@ pub async fn put_restore_opts(
if !strings_has_prefix_fold(&v.name.clone().unwrap(), "x-amz-meta") {
meta.insert(
format!("x-amz-meta-{}", v.name.as_ref().unwrap()),
v.value.clone().unwrap_or("".to_string()),
v.value.clone().unwrap_or_else(|| "".to_string()),
);
continue;
}
meta.insert(v.name.clone().unwrap(), v.value.clone().unwrap_or("".to_string()));
meta.insert(v.name.clone().unwrap(), v.value.clone().unwrap_or_else(|| "".to_string()));
}
if let Some(output_location) = rreq.output_location.as_ref() {
if let Some(s3) = &output_location.s3 {
if let Some(tags) = &s3.tagging {
meta.insert(
AMZ_OBJECT_TAGGING.to_string(),
serde_urlencoded::to_string(tags.tag_set.clone()).unwrap_or("".to_string()),
serde_urlencoded::to_string(tags.tag_set.clone()).unwrap_or_else(|_| "".to_string()),
);
}
}
@@ -636,7 +636,7 @@ impl Lifecycle for BucketLifecycleConfiguration {
storage_class: transitions[0]
.storage_class
.clone()
.unwrap_or(TransitionStorageClass::from_static(""))
.unwrap_or_else(|| TransitionStorageClass::from_static(""))
.as_str()
.to_string(),
noncurrent_days: 0,