From 9682c8b3ce2544aba2ef4d96c96c275707d7b211 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Fri, 17 Apr 2026 20:43:38 +0900 Subject: [PATCH] tee: avoid 2 Err(e) at match --- src/uu/tee/src/tee.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uu/tee/src/tee.rs b/src/uu/tee/src/tee.rs index fc0795cf62b..3306c91f864 100644 --- a/src/uu/tee/src/tee.rs +++ b/src/uu/tee/src/tee.rs @@ -134,8 +134,8 @@ fn copy(mut input: impl Read, mut output: impl Write) -> Result<()> { // `tee` does not buffer the input. output.flush()?; } - Err(e) if e.kind() == ErrorKind::Interrupted => {} - Err(e) => return Err(e), + Err(e) if e.kind() != ErrorKind::Interrupted => return Err(e), + _ => {} } } // buffer is too small optimize for large input @@ -150,8 +150,8 @@ fn copy(mut input: impl Read, mut output: impl Write) -> Result<()> { // `tee` does not buffer the input. output.flush()?; } - Err(e) if e.kind() == ErrorKind::Interrupted => {} - Err(e) => return Err(e), + Err(e) if e.kind() != ErrorKind::Interrupted => return Err(e), + _ => {} } } }