diff --git a/veilid-cli/src/command_processor.rs b/veilid-cli/src/command_processor.rs index f015db78..39d91f18 100644 --- a/veilid-cli/src/command_processor.rs +++ b/veilid-cli/src/command_processor.rs @@ -1,11 +1,10 @@ use crate::client_api_connection::*; use crate::settings::Settings; use crate::ui::*; -use log::*; use std::cell::*; use std::net::SocketAddr; use std::rc::Rc; -use std::time::{Duration, SystemTime}; +use std::time::SystemTime; use veilid_core::tools::*; use veilid_core::*; @@ -365,7 +364,7 @@ reply - reply to an AppCall not handled directly by the server debug!("Connection lost, retrying in 2 seconds"); { let waker = self.inner_mut().connection_waker.instance_clone(()); - let _ = timeout(Duration::from_millis(2000), waker).await; + let _ = timeout(2000, waker).await; } self.inner_mut().connection_waker.reset(); first = false; diff --git a/veilid-cli/src/main.rs b/veilid-cli/src/main.rs index 13692b14..9239478f 100644 --- a/veilid-cli/src/main.rs +++ b/veilid-cli/src/main.rs @@ -2,6 +2,7 @@ #![deny(unused_must_use)] #![recursion_limit = "256"] +use crate::tools::*; use veilid_core::tools::*; use clap::{Arg, ColorChoice, Command}; diff --git a/veilid-cli/src/tools.rs b/veilid-cli/src/tools.rs index 6202d490..bf58d24c 100644 --- a/veilid-cli/src/tools.rs +++ b/veilid-cli/src/tools.rs @@ -3,22 +3,12 @@ use core::future::Future; cfg_if! { if #[cfg(feature="rt-async-std")] { - pub use async_std::task::JoinHandle; pub use async_std::net::TcpStream; - pub use async_std::future::TimeoutError; - - pub use async_std::task::sleep; - pub use async_std::future::timeout; pub fn block_on, T>(f: F) -> T { async_std::task::block_on(f) } } else if #[cfg(feature="rt-tokio")] { - pub use tokio::task::JoinHandle; pub use tokio::net::TcpStream; - pub use tokio::time::error::Elapsed as TimeoutError; - - pub use tokio::time::sleep; - pub use tokio::time::timeout; pub fn block_on, T>(f: F) -> T { let rt = tokio::runtime::Runtime::new().unwrap(); let local = tokio::task::LocalSet::new();