aboutsummaryrefslogtreecommitdiffstats
path: root/src/blocking/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/blocking/input.rs')
-rw-r--r--src/blocking/input.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/blocking/input.rs b/src/blocking/input.rs
index 18e349a..6b466a2 100644
--- a/src/blocking/input.rs
+++ b/src/blocking/input.rs
@@ -303,6 +303,9 @@ impl Input {
}
match std::string::String::from_utf8(buf) {
+ // unwrap is fine because buf always contains at least the initial
+ // character, and we have already done the parsing to ensure that
+ // it contains a valid utf8 character before getting here
Ok(s) => Ok(Some(crate::Key::Char(s.chars().next().unwrap()))),
Err(e) => {
buf = e.into_bytes();