From 782d2458dc4ad4336e1407e1f107e43e39b0b991 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 10 Aug 2026 14:57:16 +0800 Subject: chore: enforce pedantic clippy lints and fix warnings --- mingling/src/parser/picker.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mingling/src/parser/picker.rs') diff --git a/mingling/src/parser/picker.rs b/mingling/src/parser/picker.rs index ca4561c..f199f5d 100644 --- a/mingling/src/parser/picker.rs +++ b/mingling/src/parser/picker.rs @@ -22,8 +22,8 @@ pub struct Picker { impl Picker { /// Creates a new `Picker` from a value that can be converted into `Argument`. - pub fn new(args: impl Into) -> Picker { - Picker { args: args.into() } + pub fn new(args: impl Into) -> Self { + Self { args: args.into() } } /// Extracts a value for the given flag and returns a `Pick1` builder (no route). @@ -50,7 +50,7 @@ impl Picker { where TNext: Pickable, { - let v = TNext::pick(&mut self.args, val.into()).unwrap_or(or.into()); + let v = TNext::pick(&mut self.args, val.into()).unwrap_or_else(|| or.into()); Pick1 { args: self.args, val_1: v, @@ -118,7 +118,7 @@ impl Picker { impl> From for Picker { fn from(value: T) -> Self { - Picker::new(value) + Self::new(value) } } @@ -342,7 +342,7 @@ macro_rules! impl_pick_next { where TNext: Pickable, { - let v = TNext::pick(&mut self.args, val.into()).unwrap_or(or.into()); + let v = TNext::pick(&mut self.args, val.into()).unwrap_or_else(|| or.into()); $next { args: self.args, $($val: self.$val,)+ @@ -647,7 +647,7 @@ macro_rules! impl_pick_with_route_next { where TNext: Pickable, { - let v = TNext::pick(&mut self.args, val.into()).unwrap_or(or.into()); + let v = TNext::pick(&mut self.args, val.into()).unwrap_or_else(|| or.into()); $next { args: self.args, $($val: self.$val,)+ -- cgit