Skip to content
Myr

fix: clippy warning for unnecessary closure

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Now that MSRV is above 1.62, we can use `then_some` instead of a simple closure.

authored by Thayne McCombs · committed by Thayne McCombs · parent ee44c1e · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/cli.rs+1 added-1 removed
693 unmodified lines
694695 pub fn max_results(&self) -> Option<usize> {696 self.max_results697 .filter(|&m| m > 0)698 .or_else(|| self.max_one_result.then(|| 1))698 .or_else(|| self.max_one_result.then_some(1))699 }700701 #[cfg(feature = "completions")]702 pub fn gen_completions(&self) -> anyhow::Result<Option<Shell>> {
159 unmodified lines