Skip to content

Commit c16c85e

Browse files
committed
Fix clippy
1 parent 0499a3c commit c16c85e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/uu/echo/src/echo.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
141141
if args.peek().is_some_and(|arg| arg == "-n") {
142142
// if POSIXLY_CORRECT is set and the first argument is the "-n" flag
143143
// we filter flags normally but 'escaped' is activated nonetheless.
144-
let (args, _) = filter_flags(args.into_iter());
144+
let (args, _) = filter_flags(args);
145145
(
146146
Box::new(args),
147147
Options {
@@ -155,7 +155,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
155155
(Box::new(args), Options::posixly_correct_default())
156156
}
157157
} else if let Some(first_arg) = args.next() {
158-
if first_arg == "--help" && args.peek() == None {
158+
if first_arg == "--help" && args.peek().is_none() {
159159
// If POSIXLY_CORRECT is not set and the first argument
160160
// is `--help`, GNU coreutils prints the help message.
161161
//
@@ -165,14 +165,14 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
165165
// echo --help
166166
uu_app().print_help()?;
167167
return Ok(());
168-
} else if first_arg == "--version" && args.peek() == None {
168+
} else if first_arg == "--version" && args.peek().is_none() {
169169
print!("{}", uu_app().render_version());
170170
return Ok(());
171-
} else {
172-
// if POSIXLY_CORRECT is not set we filter the flags normally
173-
let (args, options) = filter_flags(std::iter::once(first_arg).chain(args));
174-
(Box::new(args), options)
175171
}
172+
173+
// if POSIXLY_CORRECT is not set we filter the flags normally
174+
let (args, options) = filter_flags(std::iter::once(first_arg).chain(args));
175+
(Box::new(args), options)
176176
} else {
177177
(Box::new(args), Options::default())
178178
};

0 commit comments

Comments
 (0)