diff --git a/fish-rust/src/builtins/echo.rs b/fish-rust/src/builtins/echo.rs index 9b251cd87..f8b206481 100644 --- a/fish-rust/src/builtins/echo.rs +++ b/fish-rust/src/builtins/echo.rs @@ -4,7 +4,7 @@ use super::shared::{builtin_missing_argument, io_streams_t, STATUS_CMD_OK, STATUS_INVALID_ARGS}; use crate::ffi::parser_t; -use crate::wchar::{wchar_literal_byte, wstr, WString, L}; +use crate::wchar::{encode_byte_to_char, wstr, WString, L}; use crate::wgetopt::{wgetopter_t, woption}; #[derive(Debug, Clone, Copy)] @@ -201,7 +201,7 @@ pub fn echo( { consumed = digits_consumed; // The narrow_val is a literal byte that we want to output (#1894). - wchar_literal_byte(narrow_val) + encode_byte_to_char(narrow_val) } else { consumed = 0; '\\' diff --git a/fish-rust/src/wchar.rs b/fish-rust/src/wchar.rs index 4e2f9f75f..7f723e4f0 100644 --- a/fish-rust/src/wchar.rs +++ b/fish-rust/src/wchar.rs @@ -74,7 +74,7 @@ macro_rules! L { /// character. /// /// See https://github.com/fish-shell/fish-shell/issues/1894. -pub fn wchar_literal_byte(byte: u8) -> char { +pub fn encode_byte_to_char(byte: u8) -> char { char::from_u32(u32::from(ENCODE_DIRECT_BASE) + u32::from(byte)) .expect("private-use codepoint should be valid char") }