1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 12:37:49 +00:00

fix the significant_drop_in_scrutinee clippy warning

This commit is contained in:
Sylvestre Ledru 2022-08-10 21:37:48 +02:00
parent 8692301ec7
commit 9f1219005d
3 changed files with 6 additions and 5 deletions

View file

@ -61,8 +61,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}
} else {
let stdin = stdin();
for line in stdin.lock().lines() {
let lines = stdin.lock().lines();
for line in lines {
for number in line.unwrap().split_whitespace() {
if let Err(e) = print_factors_str(number, &mut w, &mut factors_buffer) {
show_warning!("{}: {}", number.maybe_quote(), e);

View file

@ -429,8 +429,8 @@ fn prompt(msg: &str) -> bool {
let mut buf = Vec::new();
let stdin = stdin();
let mut stdin = stdin.lock();
match stdin.read_until(b'\n', &mut buf) {
let read = stdin.read_until(b'\n', &mut buf);
match read {
Ok(x) if x > 0 => matches!(buf[0], b'y' | b'Y'),
_ => false,
}

View file

@ -474,7 +474,8 @@ fn word_count_from_input(input: &Input, settings: &Settings) -> CountResult {
Input::Stdin(_) => {
let stdin = io::stdin();
let stdin_lock = stdin.lock();
match word_count_from_reader(stdin_lock, settings) {
let count = word_count_from_reader(stdin_lock, settings);
match count {
(total, Some(error)) => CountResult::Interrupted(total, error),
(total, None) => CountResult::Success(total),
}