From 52ea5117688388a57e7e7dbdca2b8876fbcdd903 Mon Sep 17 00:00:00 2001 From: Daniel Rainer Date: Sat, 18 Oct 2025 02:20:09 +0200 Subject: [PATCH] cleanup: remove useless `INTERNAL_SEPARATOR` handling There does not seem to be a good reason for treating `INTERNAL_SEPARATOR` (`\u{fdd8}`) specially in this function. Related discussion: https://github.com/fish-shell/fish-shell/discussions/11949#discussioncomment-14712851 Closes #11971 --- src/wcstringutil.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wcstringutil.rs b/src/wcstringutil.rs index dc61f30ce..e166f1596 100644 --- a/src/wcstringutil.rs +++ b/src/wcstringutil.rs @@ -1,7 +1,6 @@ //! Helper functions for working with wcstring. use crate::common::{get_ellipsis_char, get_ellipsis_str, get_is_multibyte_locale}; -use crate::expand::INTERNAL_SEPARATOR; use crate::fallback::{fish_wcwidth, wcscasecmp, wcscasecmp_fuzzy}; use crate::flog::FLOGF; use crate::wchar::{decode_byte_from_char, prelude::*}; @@ -310,10 +309,7 @@ pub fn wcs2string_callback(input: &wstr, mut func: impl FnMut(&[u8]) -> bool) -> let is_singlebyte_locale = !get_is_multibyte_locale(); for c in input.chars() { - // TODO: this doesn't seem sound. - if c == INTERNAL_SEPARATOR { - // do nothing - } else if let Some(byte) = decode_byte_from_char(c) { + if let Some(byte) = decode_byte_from_char(c) { converted[0] = byte; if !func(&converted[..1]) { return false;