From efe3cda6ffe900efab8b2e7d5259218f17cabcb1 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Sun, 22 Dec 2024 14:26:35 +0100 Subject: [PATCH] echo: remove code made obsolete by MSRV 1.79 --- src/uu/echo/src/echo.rs | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/uu/echo/src/echo.rs b/src/uu/echo/src/echo.rs index 746cdd7c5..2d2884b1d 100644 --- a/src/uu/echo/src/echo.rs +++ b/src/uu/echo/src/echo.rs @@ -208,13 +208,6 @@ fn print_escaped(input: &[u8], output: &mut StdoutLock) -> io::Result= 1.79.0 - // https://github.com/rust-lang/rust/pull/121346 - // TODO: when we have a MSRV >= 1.79.0, delete these "hold" bindings - let hold_one_byte_outside_of_match: [u8; 1_usize]; - let hold_two_bytes_outside_of_match: [u8; 2_usize]; - let unescaped: &[u8] = match *next { b'\\' => br"\", b'a' => b"\x07", @@ -230,12 +223,7 @@ fn print_escaped(input: &[u8], output: &mut StdoutLock) -> io::Result= 1.79.0 - hold_one_byte_outside_of_match = [parsed_hexadecimal_number]; - - // TODO: when we have a MSRV >= 1.79.0, return reference to a temporary array: - // &[parsed_hexadecimal_number] - &hold_one_byte_outside_of_match + &[parsed_hexadecimal_number] } else { // "\x" with any non-hexadecimal digit after means "\x" is treated literally br"\x" @@ -246,12 +234,7 @@ fn print_escaped(input: &[u8], output: &mut StdoutLock) -> io::Result= 1.79.0 - hold_one_byte_outside_of_match = [parsed_octal_number]; - - // TODO: when we have a MSRV >= 1.79.0, return reference to a temporary array: - // &[parsed_octal_number] - &hold_one_byte_outside_of_match + &[parsed_octal_number] } else { // "\0" with any non-octal digit after it means "\0" is treated as ASCII '\0' (NUL), 0x00 b"\0" @@ -259,9 +242,7 @@ fn print_escaped(input: &[u8], output: &mut StdoutLock) -> io::Result { // Backslash and the following byte are treated literally - hold_two_bytes_outside_of_match = [b'\\', other_byte]; - - &hold_two_bytes_outside_of_match + &[b'\\', other_byte] } };