diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-01-12 08:50:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 23:50:02 -0800 |
commit | 275a5c65a20529cd4a3d775b8d8c6e9b261c76b1 (patch) | |
tree | 9f861e36e70be809d5586128a24b9f7b4332e09e /runtime/ops/net_unix.rs | |
parent | 36ff7bdf575e0547fabd8957ee778cc4224d5956 (diff) |
upgrade: tokio 1.0 (#8779)
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Diffstat (limited to 'runtime/ops/net_unix.rs')
-rw-r--r-- | runtime/ops/net_unix.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/ops/net_unix.rs b/runtime/ops/net_unix.rs index ace66425c..1177d071c 100644 --- a/runtime/ops/net_unix.rs +++ b/runtime/ops/net_unix.rs @@ -19,7 +19,6 @@ use serde::Deserialize; use std::borrow::Cow; use std::cell::RefCell; use std::fs::remove_file; -use std::os::unix; use std::path::Path; use std::rc::Rc; use tokio::net::UnixDatagram; @@ -73,7 +72,7 @@ pub(crate) async fn accept_unix( .resource_table .get::<UnixListenerResource>(rid) .ok_or_else(|| bad_resource("Listener has been closed"))?; - let mut listener = RcRef::map(&resource, |r| &r.listener) + let listener = RcRef::map(&resource, |r| &r.listener) .try_borrow_mut() .ok_or_else(|| custom_error("Busy", "Listener already in use"))?; let cancel = RcRef::map(resource, |r| &r.cancel); @@ -113,7 +112,7 @@ pub(crate) async fn receive_unix_packet( .resource_table .get::<UnixDatagramResource>(rid) .ok_or_else(|| bad_resource("Socket has been closed"))?; - let mut socket = RcRef::map(&resource, |r| &r.socket) + let socket = RcRef::map(&resource, |r| &r.socket) .try_borrow_mut() .ok_or_else(|| custom_error("Busy", "Socket already in use"))?; let cancel = RcRef::map(resource, |r| &r.cancel); @@ -131,7 +130,7 @@ pub(crate) async fn receive_unix_packet( pub fn listen_unix( state: &mut OpState, addr: &Path, -) -> Result<(u32, unix::net::SocketAddr), AnyError> { +) -> Result<(u32, tokio::net::unix::SocketAddr), AnyError> { if addr.exists() { remove_file(&addr).unwrap(); } @@ -149,7 +148,7 @@ pub fn listen_unix( pub fn listen_unix_packet( state: &mut OpState, addr: &Path, -) -> Result<(u32, unix::net::SocketAddr), AnyError> { +) -> Result<(u32, tokio::net::unix::SocketAddr), AnyError> { if addr.exists() { remove_file(&addr).unwrap(); } |