all: use let chains
This commit is contained in:
parent
3d5d146d65
commit
286857971a
89 changed files with 1516 additions and 1574 deletions
|
|
@ -30,10 +30,10 @@ impl AsyncEvent {
|
|||
}
|
||||
|
||||
pub fn trigger(&self) {
|
||||
if self.triggers.fetch_add(1) == 0 {
|
||||
if let Some(waker) = self.waker.take() {
|
||||
waker.wake();
|
||||
}
|
||||
if self.triggers.fetch_add(1) == 0
|
||||
&& let Some(waker) = self.waker.take()
|
||||
{
|
||||
waker.wake();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,13 +133,12 @@ pub fn double_fork() -> Result<Option<OwnedFd>, ForkerError> {
|
|||
}
|
||||
|
||||
pub fn ensure_reaper() -> c::pid_t {
|
||||
if let Ok(id) = env::var(REAPER_VAR) {
|
||||
if let Ok(id) = c::pid_t::from_str(&id) {
|
||||
if uapi::getppid() == id {
|
||||
set_deathsig();
|
||||
return id;
|
||||
}
|
||||
}
|
||||
if let Ok(id) = env::var(REAPER_VAR)
|
||||
&& let Ok(id) = c::pid_t::from_str(&id)
|
||||
&& uapi::getppid() == id
|
||||
{
|
||||
set_deathsig();
|
||||
return id;
|
||||
}
|
||||
let reaper_pid = uapi::getpid();
|
||||
unsafe {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue