Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

SyncReader next() behavior synced #5

Merged
merged 3 commits into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Build only pushed (merged) master or any pull request. This avoids the
# pull request to be build twice.
branches:
only:
- master

language: rust

rust:
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
- Internal refactoring (no breaking changes)
- Removed unsafe `static mut`
- Documentation update
- Fixed the `KeyEvent` `BackTab` vs `Tab` bug on the Windows platform

## Windows only

- Fixed the `KeyEvent` `BackTab` vs `Tab` bug
- `SyncReader` `Iterator` implementation returns `None` from the `next` method in case of error

# Version 0.4.1

Expand Down
5 changes: 3 additions & 2 deletions src/input/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ impl Iterator for SyncReader {
/// `None` doesn't mean that the iteration is finished. See the
/// [`SyncReader`](struct.SyncReader.html) documentation for more information.
fn next(&mut self) -> Option<Self::Item> {
// TODO Don't unwrap, consume and return `None` to sync behavior with the UNIX
read_single_event().unwrap()
// This synces the behaviour with the unix::SyncReader (& documentation) where
// None is returned in case of error.
read_single_event().unwrap_or(None)
}
}

Expand Down