Skip to content

Commit

Permalink
Fix rustfmt, clippy, and upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
elichai committed Jan 26, 2025
1 parent bb19249 commit 6c6e943
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ description = "Rust library for overriding Stdin/Stdout/Stderr with a different
categories = ["os", "development-tools::debugging"]
keywords = ["crossplatform", "sockets", "fd", "file", "io"]


[dependencies]
doc-comment = { version = "0.3", optional = true }

Expand All @@ -20,8 +19,7 @@ libc = "0.2"
winapi = { version = "0.3", features = ["processenv", "winbase", "std"] }

[dev-dependencies]
os_pipe = "0.9.2"
os_pipe = "1"

[features]
test-readme = ["doc-comment"]

test-readme = ["doc-comment"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ use stdio_override::StdinOverride;

fn main() -> io::Result<()> {
let file_name = "./test_inputs.txt";

{
let mut file = File::create(&file_name)?;
file.write_all(b"Data")?;
}

let guard = StdinOverride::from_file(file_name)?;

let mut inputs = String::new();
io::stdin().read_line(&mut inputs)?;

drop(guard);

assert_eq!("Data", inputs);
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Read for StdinOverride {
self.original.read_vectored(bufs)
}
}
impl<'a> Read for &'a StdinOverride {
impl Read for &'_ StdinOverride {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
(&*self.original).read(buf)
}
Expand Down Expand Up @@ -249,7 +249,7 @@ impl Write for StdoutOverride {
self.original.flush()
}
}
impl<'a> Write for &'a StdoutOverride {
impl Write for &'_ StdoutOverride {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
(&*self.original).write(buf)
}
Expand Down Expand Up @@ -339,7 +339,7 @@ impl Write for StderrOverride {
self.original.flush()
}
}
impl<'a> Write for &'a StderrOverride {
impl Write for &'_ StderrOverride {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
(&*self.original).write(buf)
}
Expand Down

0 comments on commit 6c6e943

Please sign in to comment.