diff --git a/src/lib.rs b/src/lib.rs index bc33cd0..b031ef8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -383,6 +383,11 @@ impl SmartString { Self { fragments } } + fn from_visible(string: T) -> Self + where T: Display { + Self { fragments: vec![(true, string.to_string())] } + } + fn char_len(&self) -> usize { self.fragments.iter() .filter(|(visible, _)| *visible)