Skip to content
Merged
Prev Previous commit
Next Next commit
Fix MSRV issue
  • Loading branch information
andrewliebenow committed Oct 20, 2024
commit 7ab6c017a7179c488e51063c9f3226ea57797252
7 changes: 6 additions & 1 deletion src/uu/echo/src/echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ fn print_escaped(input: &str, output: &mut StdoutLock) -> io::Result<ControlFlow
if let Some(next) = iter.next() {
// For extending lifetime
let sl: [u8; 1_usize];
let sli: [u8; 1_usize];

let unescaped: &[u8] = match next {
'\\' => br"\",
Expand All @@ -108,7 +109,11 @@ fn print_escaped(input: &str, output: &mut StdoutLock) -> io::Result<ControlFlow
br"\x"
}
}
'0' => &[parse_code(&mut iter, Base::Oct).unwrap_or(b'\0')],
'0' => {
sli = [parse_code(&mut iter, Base::Oct).unwrap_or(b'\0')];

&sli
}
c => {
write!(output, "\\{c}")?;

Expand Down