diff options
author | Pavel Roskin <1317472+proski@users.noreply.github.com> | 2023-10-25 16:20:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-25 23:20:58 +0000 |
commit | 75eef3be9680dbe3300186b06e19eac7f9dfab4b (patch) | |
tree | e59127474f8bdaae5be26dc53d25c3c9ed86d379 /alacritty/src/string.rs | |
parent | 500b696ca8ed61c42f5954b10f1294e875d792ae (diff) | |
download | r-alacritty-75eef3be9680dbe3300186b06e19eac7f9dfab4b.tar.gz r-alacritty-75eef3be9680dbe3300186b06e19eac7f9dfab4b.tar.bz2 r-alacritty-75eef3be9680dbe3300186b06e19eac7f9dfab4b.zip |
Fix typos
Diffstat (limited to 'alacritty/src/string.rs')
-rw-r--r-- | alacritty/src/string.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/alacritty/src/string.rs b/alacritty/src/string.rs index a111166d..e41b0785 100644 --- a/alacritty/src/string.rs +++ b/alacritty/src/string.rs @@ -30,7 +30,7 @@ pub enum ShortenDirection { /// Iterator that yield shortened version of the text. pub struct StrShortener<'a> { chars: Skip<Chars<'a>>, - accumulted_len: usize, + accumulated_len: usize, max_width: usize, direction: ShortenDirection, shortener: Option<char>, @@ -52,7 +52,7 @@ impl<'a> StrShortener<'a> { if direction == ShortenDirection::Right { return Self { chars: text.chars().skip(0), - accumulted_len: 0, + accumulated_len: 0, text_action: TextAction::Char, max_width, direction, @@ -101,7 +101,7 @@ impl<'a> StrShortener<'a> { let chars = text.chars().skip(skip_chars); - Self { chars, accumulted_len: 0, text_action, max_width, direction, shortener } + Self { chars, accumulated_len: 0, text_action, max_width, direction, shortener } } } @@ -134,12 +134,12 @@ impl<'a> Iterator for StrShortener<'a> { let ch_width = ch.width().unwrap_or(1); // Advance width. - self.accumulted_len += ch_width; + self.accumulated_len += ch_width; - if self.accumulted_len > self.max_width { + if self.accumulated_len > self.max_width { self.text_action = TextAction::Terminate; return self.shortener; - } else if self.accumulted_len == self.max_width && self.shortener.is_some() { + } else if self.accumulated_len == self.max_width && self.shortener.is_some() { // Check if we have a next char. let has_next = self.chars.clone().next().is_some(); |