diff options
author | Soispha <soispha@vhack.eu> | 2024-01-28 21:25:59 +0100 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2024-01-28 21:25:59 +0100 |
commit | 90a3452fe84236de92f987d3cebe560fc6db2e46 (patch) | |
tree | 62ac4d7bcff3912b67a79328f5806a2cea16753d /sys/nixpkgs | |
parent | fix(sys/nixpkgs/pkgs/comments): Append comments to the back of replies (diff) | |
download | nixos-config-90a3452fe84236de92f987d3cebe560fc6db2e46.tar.gz nixos-config-90a3452fe84236de92f987d3cebe560fc6db2e46.zip |
fix(sys/nixpkgs/pkgs/comments): Reduce copied `expects`
Diffstat (limited to '')
-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(()) } |