mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-03 18:55:39 +00:00
lint: clippy rules or_fun_call (#2561)
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user