fix: clippy warning for unnecessary closure

Now that MSRV is above 1.62, we can use `then_some` instead of a simple
closure.
This commit is contained in:
Thayne McCombs 2023-01-18 23:31:12 -07:00
parent ee44c1ed90
commit ccf8e69650
1 changed files with 1 additions and 1 deletions

View File

@ -695,7 +695,7 @@ impl Opts {
pub fn max_results(&self) -> Option<usize> {
self.max_results
.filter(|&m| m > 0)
.or_else(|| self.max_one_result.then(|| 1))
.or_else(|| self.max_one_result.then_some(1))
}
#[cfg(feature = "completions")]