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/args.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mingling/src/parser/args.rs') diff --git a/mingling/src/parser/args.rs b/mingling/src/parser/args.rs index 23275c2..403f88c 100644 --- a/mingling/src/parser/args.rs +++ b/mingling/src/parser/args.rs @@ -10,7 +10,7 @@ pub struct Argument { impl From> for Argument { fn from(vec: Vec<&str>) -> Self { - Argument { + Self { vec: vec .into_iter() .map(std::string::ToString::to_string) @@ -21,7 +21,7 @@ impl From> for Argument { impl From<&'static str> for Argument { fn from(s: &'static str) -> Self { - Argument { + Self { vec: vec![s.to_string()], } } @@ -29,7 +29,7 @@ impl From<&'static str> for Argument { impl From<&'static [&'static str]> for Argument { fn from(slice: &'static [&'static str]) -> Self { - Argument { + Self { vec: slice.iter().map(|&s| s.to_string()).collect(), } } @@ -37,7 +37,7 @@ impl From<&'static [&'static str]> for Argument { impl From<[&'static str; N]> for Argument { fn from(slice: [&'static str; N]) -> Self { - Argument { + Self { vec: slice.iter().map(|&s| s.to_string()).collect(), } } @@ -45,7 +45,7 @@ impl From<[&'static str; N]> for Argument { impl From<&'static [&'static str; N]> for Argument { fn from(slice: &'static [&'static str; N]) -> Self { - Argument { + Self { vec: slice.iter().map(|&s| s.to_string()).collect(), } } @@ -53,7 +53,7 @@ impl From<&'static [&'static str; N]> for Argument { impl From> for Argument { fn from(vec: Vec) -> Self { - Argument { vec } + Self { vec } } } @@ -159,7 +159,7 @@ impl Argument { } /// Dump all remaining arguments - pub fn dump_remains(&mut self) -> Vec { + pub const fn dump_remains(&mut self) -> Vec { let new = Vec::new(); replace(&mut self.vec, new) } -- cgit