diff options
author | diekmann <diekmann@net.in.tum.de> | 2017-03-26 17:06:07 +0200 |
---|---|---|
committer | diekmann <diekmann@net.in.tum.de> | 2017-04-16 18:07:07 +0200 |
commit | e568ad9c035f41bcd48f29649b5c1281e3bf7ea3 (patch) | |
tree | 1462385acca20337695cdc1d4df3194ab8c9df06 | |
parent | 2f780ef0052587415e2a3dfe934acc0e30eebee0 (diff) | |
download | nix-e568ad9c035f41bcd48f29649b5c1281e3bf7ea3.zip |
Self should not be mutated (pull request 564)
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/sys/select.rs | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3db05552..dc2deee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/sys/select.rs b/src/sys/select.rs index 1d9a76c1..eae191b6 100644 --- a/src/sys/select.rs +++ b/src/sys/select.rs @@ -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 } |