Skip to content

Commit e568ad9

Browse files
committed
Self should not be mutated (pull request 564)
1 parent 2f780ef commit e568ad9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1818
- Removed `revents` argument from `PollFd::new()` as it's an output argument and
1919
will be overwritten regardless of value.
2020
([#542](https://github.com/nix-rust/nix/pull/542))
21+
- Changed type signature of `sys::select::FdSet::contains` to make `self`
22+
immutable ([#564](https://github.com/nix-rust/nix/pull/564))
2123

2224
### Fixed
2325
- Fixed multiple issues compiling under different archetectures and OSes.

src/sys/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl FdSet {
4343
self.bits[fd / BITS] &= !(1 << (fd % BITS));
4444
}
4545

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

0 commit comments

Comments
 (0)