When using #[darling(default)], clippy warns that an if let can be simplified:
error: if let can be simplified with `.unwrap_or_default()`
--> lib/vector-config-common/src/validation.rs:178:19
|
178 | #[darling(default, rename = "min")]
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
The above lint is newly enabled in Rust 1.79.
I suspect the above is caused by the construct here, which indeed could be simplified with either .unwrap_or(#expr) or .unwrap_or_default() depending on the use case.
When using
#[darling(default)]
, clippy warns that anif let
can be simplified:The above lint is newly enabled in Rust 1.79.
I suspect the above is caused by the construct here, which indeed could be simplified with either
.unwrap_or(#expr)
or.unwrap_or_default()
depending on the use case.