Skip to content

Commit 9682c8b

Browse files
committed
tee: avoid 2 Err(e) at match
1 parent 3194190 commit 9682c8b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/uu/tee/src/tee.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ fn copy(mut input: impl Read, mut output: impl Write) -> Result<()> {
134134
// `tee` does not buffer the input.
135135
output.flush()?;
136136
}
137-
Err(e) if e.kind() == ErrorKind::Interrupted => {}
138-
Err(e) => return Err(e),
137+
Err(e) if e.kind() != ErrorKind::Interrupted => return Err(e),
138+
_ => {}
139139
}
140140
}
141141
// buffer is too small optimize for large input
@@ -150,8 +150,8 @@ fn copy(mut input: impl Read, mut output: impl Write) -> Result<()> {
150150
// `tee` does not buffer the input.
151151
output.flush()?;
152152
}
153-
Err(e) if e.kind() == ErrorKind::Interrupted => {}
154-
Err(e) => return Err(e),
153+
Err(e) if e.kind() != ErrorKind::Interrupted => return Err(e),
154+
_ => {}
155155
}
156156
}
157157
}

0 commit comments

Comments
 (0)