From 275a5c65a20529cd4a3d775b8d8c6e9b261c76b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 12 Jan 2021 08:50:02 +0100 Subject: upgrade: tokio 1.0 (#8779) Co-authored-by: Bert Belder --- runtime/ops/net_unix.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'runtime/ops/net_unix.rs') 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::(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::(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(); } -- cgit v1.2.3