Skip to content

Commit 729bdc7

Browse files
committed
review changes
1 parent 6881624 commit 729bdc7

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1212
([#672](https://github.com/nix-rust/nix/pull/672))
1313
- Added protocol families in `AddressFamily` enum.
1414
([#647](https://github.com/nix-rust/nix/pull/647))
15-
- Added a convenience method `.pid()` to the `enum WaitStatus`
15+
- Added the `pid()` method to `WaitStatus` for extracting the PID.
1616
([#722](https://github.com/nix-rust/nix/pull/722))
1717

1818
### Changed

src/sys/wait.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,20 @@ pub enum WaitStatus {
9494
}
9595

9696
impl WaitStatus {
97-
/// Extracts the PID from the WaitStatus if the status is not StillAlive.
97+
/// Extracts the PID from the WaitStatus unless it equals StillAlive.
9898
pub fn pid(&self) -> Option<Pid> {
9999
use self::WaitStatus::*;
100-
match self {
101-
&Exited(p, _) => Some(p),
102-
&Signaled(p, _, _) => Some(p),
103-
&Stopped(p, _) => Some(p),
104-
&Continued(p) => Some(p),
105-
&StillAlive => None,
100+
match *self {
101+
Exited(p, _) => Some(p),
102+
Signaled(p, _, _) => Some(p),
103+
Stopped(p, _) => Some(p),
104+
Continued(p) => Some(p),
105+
StillAlive => None,
106106

107107
#[cfg(any(target_os = "linux", target_os = "android"))]
108-
&PtraceEvent(p, _, _) => Some(p),
108+
PtraceEvent(p, _, _) => Some(p),
109109
#[cfg(any(target_os = "linux", target_os = "android"))]
110-
&PtraceSyscall(p) => Some(p),
110+
PtraceSyscall(p) => Some(p),
111111
}
112112
}
113113
}

0 commit comments

Comments
 (0)