From 276d05d507d40e1391ea57edf59c44b884e32497 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Wed, 6 Aug 2025 12:26:40 -0700 Subject: [PATCH] fix(fmt): don't panic on stdin read failure --- Makefile | 2 +- crates/forge/src/cmd/fmt.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ef984b04f8dc7..0b8cfb44d9f2d 100644 --- a/Makefile +++ b/Makefile @@ -150,4 +150,4 @@ dprint-check: ## Check formatting with dprint echo "Installing dprint..."; \ cargo install dprint; \ fi - dprint check \ No newline at end of file + dprint check diff --git a/crates/forge/src/cmd/fmt.rs b/crates/forge/src/cmd/fmt.rs index 60551841cc1d3..e1c4532572b63 100644 --- a/crates/forge/src/cmd/fmt.rs +++ b/crates/forge/src/cmd/fmt.rs @@ -70,7 +70,7 @@ impl FmtArgs { } [one] if one == Path::new("-") => { let mut s = String::new(); - io::stdin().read_to_string(&mut s).expect("Failed to read from stdin"); + io::stdin().read_to_string(&mut s).wrap_err("failed to read from stdin")?; Input::Stdin(s) } paths => {