Skip to content

Commit

Permalink
style: Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jan 18, 2024
1 parent c088820 commit 939687d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/fmt/writer/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The terminal printing is shimmed when the `termcolor` crate is not available.
#[cfg(feature = "color")]
mod termcolor;
#[cfg(feature = "color")]
pub(in crate::fmt) use termcolor::*;
pub(in crate::fmt) use self::termcolor::*;
#[cfg(not(feature = "color"))]
mod plain;
#[cfg(not(feature = "color"))]
Expand Down
6 changes: 4 additions & 2 deletions src/fmt/writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ impl WritableTarget {
let buf = buf.as_bytes();
match self {
WritableTarget::WriteStdout => {
let mut stream = std::io::stdout().lock();
let stream = std::io::stdout();
let mut stream = stream.lock();
stream.write_all(buf)?;
stream.flush()?;
}
WritableTarget::PrintStdout => print!("{}", String::from_utf8_lossy(buf)),
WritableTarget::WriteStderr => {
let mut stream = std::io::stderr().lock();
let stream = std::io::stderr();
let mut stream = stream.lock();
stream.write_all(buf)?;
stream.flush()?;
}
Expand Down

0 comments on commit 939687d

Please sign in to comment.