fix: remove func call from alternative value.

this avoid useless allocation or non-trivial work, if the default value
is not needed/used.

add a line in Cargo.toml to easly enable or_fun_call lint
help: https://rust-lang.github.io/rust-clippy/master/index.html?search=or_fun_call
This commit is contained in:
Gwen Lg
2026-01-28 11:07:24 +01:00
committed by Alex
parent f6414210fa
commit b060a7e0f1
8 changed files with 29 additions and 18 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ impl Endpoint {
let (bucket, partition_key) = path
.split_once('/')
.map(|(b, p)| (b.to_owned(), p.trim_start_matches('/')))
.unwrap_or((path.to_owned(), ""));
.unwrap_or_else(|| (path.to_owned(), ""));
if bucket.is_empty() {
return Err(Error::bad_request("Missing bucket name"));