mirror of
https://gitlab.com/arnekeller/ascii-table.git
synced 2024-12-04 21:49:08 +00:00
save game
This commit is contained in:
parent
757531723a
commit
e6f23201c4
10
src/lib.rs
10
src/lib.rs
@ -400,7 +400,15 @@ impl SmartString {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn lpush_visible(&mut self, ch: char) {
|
fn lpush_visible(&mut self, ch: char) {
|
||||||
todo!()
|
let last_fragment = self.fragments.iter_mut()
|
||||||
|
.filter(|(visible, _)| *visible)
|
||||||
|
.map(|(_, string)| string)
|
||||||
|
.next();
|
||||||
|
if let Some(fragment) = last_fragment {
|
||||||
|
fragment.push(ch);
|
||||||
|
} else {
|
||||||
|
self.fragments.insert(0, (true, ch.to_string()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user