dont error hard on invalid utf8 input

This commit is contained in:
Robin Appelman 2020-03-21 13:27:06 +01:00
commit 00e48c4f28

View file

@ -55,8 +55,10 @@ fn main() -> Result<(), MainError> {
while let Some(Ok(mut stream)) = incoming.next() {
text_buffer.clear();
stream.read_to_string(&mut text_buffer)?;
type_string(&mut keyboard, &text_buffer)?;
match stream.read_to_string(&mut text_buffer) {
Ok(_) => type_string(&mut keyboard, &text_buffer)?,
Err(e) => eprintln!("{}", e),
}
}
Ok(())