Skip to content

Commit

Permalink
Self should not be mutated (pull request 564)
Browse files Browse the repository at this point in the history
  • Loading branch information
diekmann committed Apr 16, 2017
1 parent 2f780ef commit e568ad9
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 e568ad9

Please sign in to comment.