From a93a2a8eb3fae7f425fa4ad0b9a4d47ace7aabf0 Mon Sep 17 00:00:00 2001 From: Gerrit Viljoen Date: Sun, 17 May 2020 11:55:13 +0200 Subject: [PATCH] save game --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0b84dcb..e157d74 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -400,11 +400,11 @@ impl SmartString { } fn lpush_visible(&mut self, ch: char) { - let last_fragment = self.fragments.iter_mut() + let first_fragment = self.fragments.iter_mut() .filter(|(visible, _)| *visible) .map(|(_, string)| string) .next(); - if let Some(fragment) = last_fragment { + if let Some(fragment) = first_fragment { fragment.push(ch); } else { self.fragments.insert(0, (true, ch.to_string()));