aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/input.rs
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/src/input.rs
parent2a676dfad837d1784ed0911d314bc263804ef4ef (diff)
downloadr-alacritty-48454c004700e359c3c496871643913fb20de84f.tar.gz
r-alacritty-48454c004700e359c3c496871643913fb20de84f.tar.bz2
r-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/src/input.rs')
-rw-r--r--alacritty/src/input.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs
index 37cd4f92..9f076e1b 100644
--- a/alacritty/src/input.rs
+++ b/alacritty/src/input.rs
@@ -717,13 +717,13 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
{
let size = self.ctx.size_info();
- let current_lines = self.ctx.message().map(|m| m.text(&size).len()).unwrap_or(0);
+ let current_lines = self.ctx.message().map_or(0, |m| m.text(&size).len());
self.ctx.clear_selection();
self.ctx.pop_message();
// Reset cursor when message bar height changed or all messages are gone.
- let new_lines = self.ctx.message().map(|m| m.text(&size).len()).unwrap_or(0);
+ let new_lines = self.ctx.message().map_or(0, |m| m.text(&size).len());
let new_icon = match current_lines.cmp(&new_lines) {
Ordering::Less => CursorIcon::Default,