Skip to content

Commit d887038

Browse files
committed
head: saturate to max int size on 32 bit platforms
1 parent 9ddc928 commit d887038

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

‎src/uu/head/src/head.rs‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,7 @@ fn read_n_lines(input: &mut impl io::BufRead, n: u64, separator: u8) -> io::Resu
282282
}
283283

284284
fn catch_too_large_numbers_in_backwards_bytes_or_lines(n: u64) -> Option<usize> {
285-
match usize::try_from(n) {
286-
Ok(value) => Some(value),
287-
Err(e) => {
288-
show!(HeadError::NumTooLarge(e));
289-
None
290-
}
291-
}
285+
usize::try_from(n).ok()
292286
}
293287

294288
fn read_but_last_n_bytes(mut input: impl Read, n: u64) -> io::Result<u64> {

0 commit comments

Comments
 (0)