From 385cdef89b28f136d5d4be8819ca14f00ffd902b Mon Sep 17 00:00:00 2001 From: Daniel Rainer Date: Mon, 12 Jan 2026 16:35:10 +0100 Subject: [PATCH] wchar: don't wrap `utf32str` macro There is no need to wrap this macro. We can just introduce `L` as an alias. https://github.com/fish-shell/fish-shell/pull/12311#discussion_r2681174391 Closes #12312 --- crates/wchar/src/lib.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/crates/wchar/src/lib.rs b/crates/wchar/src/lib.rs index 42ffe24aa..23471efb1 100644 --- a/crates/wchar/src/lib.rs +++ b/crates/wchar/src/lib.rs @@ -8,22 +8,12 @@ use fish_common::{ENCODE_DIRECT_BASE, ENCODE_DIRECT_END, subslice_position}; use std::{iter, slice}; -pub use widestring::{Utf32Str as wstr, Utf32String as WString, utfstr::CharsUtf32}; +pub use widestring::{Utf32Str as wstr, Utf32String as WString, utf32str as L, utfstr::CharsUtf32}; pub mod prelude { pub use crate::{IntoCharIter, L, ToWString, WExt, WString, wstr}; } -/// Creates a wstr string slice, like the "L" prefix of C++. -/// The result is of type wstr. -/// It is NOT nul-terminated. -#[macro_export] -macro_rules! L { - ($string:expr) => { - widestring::utf32str!($string) - }; -} - /// Encode a literal byte in a UTF-32 character. This is required for e.g. the echo builtin, whose /// escape sequences can be used to construct raw byte sequences which are then interpreted as e.g. /// UTF-8 by the terminal. If we were to interpret each of those bytes as a codepoint and encode it