diff options
-rw-r--r-- | sys/nixpkgs/pkgs/comments/src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/nixpkgs/pkgs/comments/src/main.rs b/sys/nixpkgs/pkgs/comments/src/main.rs index 05f0e8cd..12a89b7e 100644 --- a/sys/nixpkgs/pkgs/comments/src/main.rs +++ b/sys/nixpkgs/pkgs/comments/src/main.rs @@ -290,7 +290,7 @@ fn main() -> anyhow::Result<()> { .stdin(Stdio::piped()) .stderr(Stdio::inherit()) .spawn() - .expect("Should work"); + .context("Failed to run less")?; let mut child = Command::new("fmt") .args(["--uniform-spacing", "--split-only", "--width=90"]) @@ -298,16 +298,16 @@ fn main() -> anyhow::Result<()> { .stderr(Stdio::inherit()) .stdout(less.stdin.take().expect("Should be open")) .spawn() - .expect("Failed to spawn child process"); + .context("Failed to run fmt")?; - let mut stdin = child.stdin.take().expect("Failed to open stdin"); + let mut stdin = child.stdin.take().context("Failed to open stdin")?; std::thread::spawn(move || { stdin .write_all(comments.to_string().as_bytes()) - .expect("Failed to write to stdin"); + .expect("Should be able to write to stdin of fmt"); }); - let _ = less.wait().expect("Failed to read stdout"); + let _ = less.wait().context("Failed to await less")?; Ok(()) } |