Skip to content
Snippets Groups Projects
Commit e81a1c4c authored by AdminXVII's avatar AdminXVII
Browse files

Make the keys return their inner error, if any. For example, when permission...

Make the keys return their inner error, if any. For example, when permission to access the TTY is denied, don't loop infinitely and instead return to the outer scope to error and exit (or not) there.
parent 68d76530
No related branches found
No related tags found
1 merge request!162Make the keys return their inner error, if any.
Pipeline #4894 passed
...@@ -19,7 +19,7 @@ impl<R: Read> Iterator for Keys<R> { ...@@ -19,7 +19,7 @@ impl<R: Read> Iterator for Keys<R> {
match self.iter.next() { match self.iter.next() {
Some(Ok(Event::Key(k))) => return Some(Ok(k)), Some(Ok(Event::Key(k))) => return Some(Ok(k)),
Some(Ok(_)) => continue, Some(Ok(_)) => continue,
e @ Some(Err(_)) => e, Some(Err(e)) => return Some(Err(e)),
None => return None, None => return None,
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment