From 239da146c06b3a8c63c38c7bd8b7c62f621f9cd5 Mon Sep 17 00:00:00 2001 From: Gerrit Viljoen Date: Sun, 17 May 2020 12:35:46 +0200 Subject: [PATCH] save game --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) 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)