aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/grid
diff options
context:
space:
mode:
authorChris Copeland <chris@chrisnc.net>2022-07-20 01:24:27 -0700
committerGitHub <noreply@github.com>2022-07-20 11:24:27 +0300
commit48454c004700e359c3c496871643913fb20de84f (patch)
tree754d68e806486a02ac8ce088e87e7c7105832e4a /alacritty_terminal/src/grid
parent2a676dfad837d1784ed0911d314bc263804ef4ef (diff)
downloadalacritty-48454c004700e359c3c496871643913fb20de84f.tar.gz
alacritty-48454c004700e359c3c496871643913fb20de84f.zip
Replace `map().unwrap_or()` with `map_or()`
Use a `map_or` instead of a `map().unwrap_or()` chain.
Diffstat (limited to 'alacritty_terminal/src/grid')
-rw-r--r--alacritty_terminal/src/grid/row.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/alacritty_terminal/src/grid/row.rs b/alacritty_terminal/src/grid/row.rs
index 900d2a76..2a92a78c 100644
--- a/alacritty_terminal/src/grid/row.rs
+++ b/alacritty_terminal/src/grid/row.rs
@@ -76,7 +76,7 @@ impl<T: Clone + Default> Row<T> {
// Split off cells for a new row.
let mut new_row = self.inner.split_off(columns);
- let index = new_row.iter().rposition(|c| !c.is_empty()).map(|i| i + 1).unwrap_or(0);
+ let index = new_row.iter().rposition(|c| !c.is_empty()).map_or(0, |i| i + 1);
new_row.truncate(index);
self.occ = min(self.occ, columns);