Skip to content

Commit

Permalink
Merge #564
Browse files Browse the repository at this point in the history
564: select.rs FdSet: method `contains' should not mutate anything r=posborne
The method does not change anything, so I updated the type signature. Tests pass.
  • Loading branch information
bors[bot] committed Apr 17, 2017
2 parents 3a50aeb + e568ad9 commit 7b5dd78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Removed `revents` argument from `PollFd::new()` as it's an output argument and
will be overwritten regardless of value.
([#542](https://github.com/nix-rust/nix/pull/542))
- Changed type signature of `sys::select::FdSet::contains` to make `self`
immutable ([#564](https://github.com/nix-rust/nix/pull/564))

### Fixed
- Fixed multiple issues compiling under different archetectures and OSes.
Expand Down
2 changes: 1 addition & 1 deletion src/sys/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl FdSet {
self.bits[fd / BITS] &= !(1 << (fd % BITS));
}

pub fn contains(&mut self, fd: RawFd) -> bool {
pub fn contains(&self, fd: RawFd) -> bool {
let fd = fd as usize;
self.bits[fd / BITS] & (1 << (fd % BITS)) > 0
}
Expand Down

0 comments on commit 7b5dd78

Please sign in to comment.