Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hommeabeil committed Feb 3, 2022
1 parent 4ab4144 commit 60e1ebb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion actix-server/src/accept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl Accept {
.for_each(|(_, info)| self.deregister_logged(info));
}

fn terminate_all(&self, sockets: &mut[ServerSocketInfo]) {
fn terminate_all(&self, sockets: &mut [ServerSocketInfo]) {
sockets.iter().for_each(|s| s.lst.terminate());
}

Expand Down
15 changes: 6 additions & 9 deletions actix-server/src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ impl MioListener {
match *self {
MioListener::Tcp(ref lst) => lst.accept().map(|(stream, _)| MioStream::Tcp(stream)),
#[cfg(unix)]
MioListener::Uds(ref lst) => {
lst.accept().map(|(stream, _)| MioStream::Uds(stream))
}
MioListener::Uds(ref lst) => lst.accept().map(|(stream, _)| MioStream::Uds(stream)),
}
}

Expand All @@ -49,17 +47,16 @@ impl MioListener {
MioListener::Tcp(_) => (),
#[cfg(unix)]
MioListener::Uds(ref lst) => {
if let Ok(addr) = lst.local_addr() {
if let Some(path) = addr.as_pathname() {
let _ = std::fs::remove_file(path);
}
if let Ok(addr) = lst.local_addr() {
if let Some(path) = addr.as_pathname() {
let _ = std::fs::remove_file(path);
}
}
}
}
}
}


impl Source for MioListener {
fn register(
&mut self,
Expand Down Expand Up @@ -91,7 +88,7 @@ impl Source for MioListener {
match *self {
MioListener::Tcp(ref mut lst) => lst.deregister(registry),
#[cfg(unix)]
MioListener::Uds(ref mut lst) => lst.deregister(registry)
MioListener::Uds(ref mut lst) => lst.deregister(registry),
}
}
}
Expand Down

0 comments on commit 60e1ebb

Please sign in to comment.