diff --git a/src/read/fallback_mode.rs b/src/read/fallback_mode.rs index 759ac890..1123a2b2 100644 --- a/src/read/fallback_mode.rs +++ b/src/read/fallback_mode.rs @@ -6,9 +6,19 @@ use std::io::{Error, ErrorKind, Read}; // // Retrieve a single byte from stdin, does not support full Unicode decoding; only convert // byte to KeyEvent char if it falls within the ASCII subset of UTF-8. -// // Does not support passing through Ctrl-C as a KeyEvent. +// +// We are not supporting multibyte UTF-8 encodings because we are only +// interested in single ASCII characters which are 1-byte UTF-8 characters. +// Multibyte non-ASCII characters would be ignored anyway, so it's not worth the effort. +// +// It is expected that `limited_support_read` will only be used when prompting for user +// input during solution enumeration and the available commands are single ASCII characters. pub(crate) fn limited_support_read() -> std::io::Result { + #[allow( + clippy::unbuffered_bytes, + reason = "We are aware of `bytes()` performance pitfall but don't expect it to be relevant here, we are doing single byte user input I/O." + )] let byte_or_none = std::io::stdin().bytes().next(); match byte_or_none {