From 2e97e2dbfddcfa7102b303cd8b49438f3e20e5d2 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 20 Oct 2022 18:38:27 -0600 Subject: [PATCH] Apply a slight stylistic tweak --- crates/gpui/src/keymap.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/gpui/src/keymap.rs b/crates/gpui/src/keymap.rs index 5d000081cf..be846bbfa1 100644 --- a/crates/gpui/src/keymap.rs +++ b/crates/gpui/src/keymap.rs @@ -301,9 +301,7 @@ impl Keystroke { } } - if key.is_none() { - return Err(anyhow!("Invalid keystroke `{}`", source)); - } + let key = key.ok_or_else(|| anyhow!("Invalid keystroke `{}`", source))?; Ok(Keystroke { ctrl, @@ -311,7 +309,7 @@ impl Keystroke { shift, cmd, function, - key: key.unwrap(), + key, }) }