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
+11 -8
View File
@@ -38,14 +38,17 @@ impl SetDisks {
let upload_uuid = base64_simd::URL_SAFE_NO_PAD
.decode_to_vec(upload_id.as_bytes())
.and_then(|v| {
String::from_utf8(v).map_or(Ok(upload_id.to_owned()), |v| {
let parts: Vec<_> = v.splitn(2, '.').collect();
if parts.len() == 2 {
Ok(parts[1].to_string())
} else {
Ok(upload_id.to_string())
}
})
String::from_utf8(v).map_or_else(
|_| Ok(upload_id.to_owned()),
|v| {
let parts: Vec<_> = v.splitn(2, '.').collect();
if parts.len() == 2 {
Ok(parts[1].to_string())
} else {
Ok(upload_id.to_string())
}
},
)
})
.unwrap_or_default();