diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-09 02:57:28 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-09 02:57:28 -0500 |
commit | c4831851936c7c7f707b3c8350ba3ffad9647ba8 (patch) | |
tree | e2c9f66aa45a587748d65e48861ff82d392b2806 /src/blocking | |
parent | 0cf66f816712e8e8adb941fff57823625611370a (diff) | |
download | textmode-c4831851936c7c7f707b3c8350ba3ffad9647ba8.tar.gz textmode-c4831851936c7c7f707b3c8350ba3ffad9647ba8.zip |
comment
Diffstat (limited to 'src/blocking')
-rw-r--r-- | src/blocking/input.rs | 3 |
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(); |