clean up & remove warning messages

This commit is contained in:
ghassmo
2022-02-27 00:50:38 +04:00
parent 1a901f50de
commit aad2caa3df
7 changed files with 26 additions and 30 deletions

View File

@@ -1,6 +1,3 @@
use async_executor::Executor;
use std::sync::Arc;
use clap::{IntoApp, Parser, Subcommand};
use log::{debug, error};
use serde_json::{json, Value};
@@ -8,7 +5,6 @@ use url::Url;
use darkfi::{
rpc::{jsonrpc, jsonrpc::JsonResult},
util::{async_util, cli::Config},
Error, Result,
};
@@ -89,7 +85,7 @@ async fn start(options: CliDao) -> Result<()> {
#[async_std::main]
async fn main() -> Result<()> {
let args = CliDao::parse();
let matches = CliDao::into_app().get_matches();
let _matches = CliDao::into_app().get_matches();
//let config_path = if args.config.is_some() {
// expand_path(&args.config.clone().unwrap())?

View File

@@ -3,22 +3,22 @@ use futures::{
io::{ReadHalf, WriteHalf},
AsyncReadExt,
};
use std::{
net::{SocketAddr, TcpStream},
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
};
use log::*;
use smol::{Async, Executor};
use std::net::{SocketAddr, TcpStream};
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
use crate::{
error::{Error, Result},
net::{
message,
message_subscriber::{MessageSubscription, MessageSubsystem},
protocol::{ProtocolBase, ProtocolBasePtr},
},
system::{StoppableTask, StoppableTaskPtr, Subscriber, SubscriberPtr, Subscription},
};

View File

@@ -1,8 +1,9 @@
use async_trait::async_trait;
use log::{debug, error};
use smol::Executor;
use std::sync::Arc;
use async_trait::async_trait;
use log::debug;
use smol::Executor;
use crate::{
error::Result,
net::{

View File

@@ -1,14 +1,14 @@
use async_executor::Executor;
use log::*;
use std::{
net::SocketAddr,
sync::{Arc, Weak},
};
use async_executor::Executor;
use log::*;
use crate::{
error::{Error, Result},
net::{
protocol::{ProtocolAddress, ProtocolBase, ProtocolPing},
session::{Session, SessionBitflag, SESSION_INBOUND},
Acceptor, AcceptorPtr, ChannelPtr, P2p,
},

View File

@@ -1,17 +1,17 @@
use async_executor::Executor;
use async_std::sync::Mutex;
use log::*;
use std::{
net::SocketAddr,
sync::{Arc, Weak},
};
use async_executor::Executor;
use log::*;
use crate::{
error::{Error, Result},
net::{
protocol::{ProtocolAddress, ProtocolBase, ProtocolPing},
session::{Session, SessionBitflag, SESSION_MANUAL},
ChannelPtr, Connector, P2p,
Connector, P2p,
},
system::{StoppableTask, StoppableTaskPtr},
util::sleep,

View File

@@ -9,9 +9,8 @@ use std::{
use crate::{
error::{Error, Result},
net::{
protocol::{ProtocolAddress, ProtocolBase, ProtocolPing},
session::{Session, SessionBitflag, SESSION_OUTBOUND},
ChannelPtr, Connector, P2p,
Connector, P2p,
},
system::{StoppableTask, StoppableTaskPtr},
};

View File

@@ -1,18 +1,18 @@
use async_executor::Executor;
use async_std::future::timeout;
use log::*;
use std::{
net::SocketAddr,
sync::{Arc, Weak},
time::Duration,
};
use async_executor::Executor;
use log::*;
use crate::{
error::{Error, Result},
net::{
protocol::{ProtocolBase, ProtocolPing, ProtocolSeed},
session::{Session, SessionBitflag, SESSION_SEED},
ChannelPtr, Connector, HostsPtr, P2p, SettingsPtr,
Connector, P2p,
},
};
@@ -88,7 +88,7 @@ impl SeedSession {
executor: Arc<Executor<'_>>,
) -> Result<()> {
debug!(target: "net", "SeedSession::start_seed(i={}) [START]", seed_index);
let (hosts, settings) = {
let (_hosts, settings) = {
let p2p = self.p2p.upgrade().unwrap();
(p2p.hosts(), p2p.settings())
};