diff --git a/fish-rust/src/wchar_ext.rs b/fish-rust/src/wchar_ext.rs index 7f7633f1c..f50ae8a45 100644 --- a/fish-rust/src/wchar_ext.rs +++ b/fish-rust/src/wchar_ext.rs @@ -1,3 +1,5 @@ +use std::{iter, slice}; + use crate::wchar::{wstr, WString}; use widestring::utfstr::CharsUtf32; @@ -102,6 +104,14 @@ impl<'a> IntoCharIter for &'a str { } } +impl<'a> IntoCharIter for &'a [char] { + type Iter = iter::Copied>; + + fn chars(self) -> Self::Iter { + self.iter().copied() + } +} + impl<'a> IntoCharIter for &'a wstr { type Iter = CharsUtf32<'a>; fn chars(self) -> Self::Iter {