mirror of
https://github.com/fafhrd91/actix-net
synced 2025-03-15 22:03:05 +01:00
fmt
This commit is contained in:
parent
4ab41440ad
commit
60e1ebb503
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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)),
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user