Skip to content

Commit 36da0af

Browse files
hanbingssylvestre
authored andcommitted
Run cargo clippy.
1 parent a673575 commit 36da0af

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

src/find/matchers/exec.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use std::error::Error;
88
use std::ffi::OsString;
9-
use std::io::{stderr, stdin, stdout, Write};
9+
use std::io::{stderr, stdin, Write};
1010
use std::path::Path;
1111
use std::process::Command;
1212
use walkdir::DirEntry;
@@ -69,9 +69,12 @@ impl Matcher for SingleExecMatcher {
6969

7070
// support interactive exec
7171
if self.interactive {
72-
let tips = format!("{} ... {} > ? [y/n]: ", self.executable, path_to_file.to_string_lossy());
73-
write!(stdout(), "{}", tips).unwrap();
74-
stdout().flush().unwrap();
72+
let tips = format!(
73+
"{} ... {} > ? [y/n]: ",
74+
self.executable,
75+
path_to_file.to_string_lossy()
76+
);
77+
print!("{}", tips);
7578

7679
let mut input = String::new();
7780
let _result = stdin().read_line(&mut input).unwrap();

src/find/matchers/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,13 @@ fn build_matcher_tree(
492492
let interactive = expression == "-ok" || expression == "-okdir";
493493
i = arg_index;
494494
Some(
495-
SingleExecMatcher::new(executable, exec_args, expression == "-execdir", interactive)?
496-
.into_box(),
495+
SingleExecMatcher::new(
496+
executable,
497+
exec_args,
498+
expression == "-execdir",
499+
interactive,
500+
)?
501+
.into_box(),
497502
)
498503
}
499504
"-inum" => {

tests/exec_unit_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn matching_embedded_filename() {
9999
&path_to_testing_commandline(),
100100
&[temp_dir_path.as_ref(), "abc{}x{}yz"],
101101
false,
102-
false
102+
false,
103103
)
104104
.expect("Failed to create matcher");
105105
let deps = FakeDependencies::new();

0 commit comments

Comments
 (0)