save game

This commit is contained in:
Gerrit Viljoen 2020-05-17 12:35:46 +02:00
parent d7f0279051
commit 239da146c0

View File

@ -383,6 +383,11 @@ impl SmartString {
Self { fragments } Self { fragments }
} }
fn from_visible<T>(string: T) -> Self
where T: Display {
Self { fragments: vec![(true, string.to_string())] }
}
fn char_len(&self) -> usize { fn char_len(&self) -> usize {
self.fragments.iter() self.fragments.iter()
.filter(|(visible, _)| *visible) .filter(|(visible, _)| *visible)