Skip to content

Commit

Permalink
tail: Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Joining7943 committed Apr 2, 2023
1 parent 13c566b commit d5c0774
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/uu/tail/src/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,10 +726,7 @@ mod tests {
let result = chunk.fill(&mut cursor);
assert!(result.is_ok());
let option = result.unwrap();
return match option {
Some(size) => size,
None => 0,
};
option.unwrap_or(0)
}

fn fill_lines_chunk_buffer(buffer: &mut LinesChunkBuffer, data: &str) -> u64 {
Expand Down
6 changes: 3 additions & 3 deletions src/uu/tail/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ mod tests {
use std::io::{Read, Write};
use tempfile::NamedTempFile;

fn run_and_assert(mut file: File, mut handler: IOErrorHandler, expected: String) {
fn run_and_assert(mut file: File, mut handler: IOErrorHandler, expected: &str) {
let mut buffer = String::new();
if let Err(error) = file.read_to_string(&mut buffer) {
match handler.handle(IoContextError::new(error, IoErrorContext::Stat)) {
Expand Down Expand Up @@ -356,7 +356,7 @@ mod tests {
path.display()
);

run_and_assert(file, handler, expected);
run_and_assert(file, handler, &expected);

// setup
let handler = IOErrorHandler::with_printer(
Expand All @@ -378,7 +378,7 @@ mod tests {
path.display()
);

run_and_assert(file, handler, expected);
run_and_assert(file, handler, &expected);
}

#[test]
Expand Down

0 comments on commit d5c0774

Please sign in to comment.