Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k committed Oct 17, 2023
1 parent b5deff7 commit 98c2260
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl LineReader for BufReader<Box<dyn Read>> {
fn read_line(&mut self) -> Option<Result<String>> {
let mut buf = String::with_capacity(1024);
match std::io::BufRead::read_line(self, &mut buf) {
Ok(n) if n == 0 => None,
Ok(0) => None,
Ok(_) => Some(Ok(buf)),
Err(e) => Some(Err(e.into())),
}
Expand All @@ -54,7 +54,7 @@ pub fn open_data<P: AsRef<Path>>(
) -> Result<Box<dyn LineReader>> {
// Read from stdin if input is '-', else try to open the provided file.
let reader: Box<dyn Read> = match path.as_ref().to_str() {
Some(p) if p == "-" => Box::new(std::io::stdin()),
Some("-") => Box::new(std::io::stdin()),
Some(p) => Box::new(File::open(p)?),
_ => unreachable!(),
};
Expand Down

0 comments on commit 98c2260

Please sign in to comment.