From e568ad9c035f41bcd48f29649b5c1281e3bf7ea3 Mon Sep 17 00:00:00 2001 From: diekmann Date: Sun, 26 Mar 2017 17:06:07 +0200 Subject: [PATCH] Self should not be mutated (pull request 564) --- CHANGELOG.md | 2 ++ src/sys/select.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3db0555213..dc2deee593 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 1d9a76c1d4..eae191b6e4 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 }