From 3eecb969d5440b68bbcc808a062661223c60681e Mon Sep 17 00:00:00 2001 From: Chubby Puddles Esq Date: Thu, 9 Jan 2020 16:49:44 -0800 Subject: formatting issues --- CONTRIBUTING.md | 2 ++ src/network/dns/client.rs | 2 +- src/network/dns/resolver.rs | 2 +- src/os/shared.rs | 6 ++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 287ddf0..ff82cca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,8 @@ To set up your development environment: To run tests: `cargo test` +After tests, check the formatting: `cargo fmt -- --check` + Note that at the moment the tests do not test the os layer (anything in the `os` folder). If you are stuck, unsure about how to approach an issue or would like some guidance, you are welcome to contact: aram@poor.dev diff --git a/src/network/dns/client.rs b/src/network/dns/client.rs index b6796b4..f9d12ed 100644 --- a/src/network/dns/client.rs +++ b/src/network/dns/client.rs @@ -24,7 +24,7 @@ pub struct Client { impl Client { pub fn new(resolver: R, mut runtime: Runtime) -> Result where - R: Lookup + Send + Sync + 'static + R: Lookup + Send + Sync + 'static, { let cache = Arc::new(Mutex::new(IpTable::new())); let pending = Arc::new(Mutex::new(PendingAddrs::new())); diff --git a/src/network/dns/resolver.rs b/src/network/dns/resolver.rs index 87e9a2c..d802a26 100644 --- a/src/network/dns/resolver.rs +++ b/src/network/dns/resolver.rs @@ -1,7 +1,7 @@ use async_trait::async_trait; use std::net::Ipv4Addr; -use trust_dns_resolver::{error::ResolveErrorKind, AsyncResolver, TokioAsyncResolver}; use tokio::runtime::Handle; +use trust_dns_resolver::{error::ResolveErrorKind, AsyncResolver, TokioAsyncResolver}; #[async_trait] pub trait Lookup { diff --git a/src/os/shared.rs b/src/os/shared.rs index 441e534..d2c2c34 100644 --- a/src/os/shared.rs +++ b/src/os/shared.rs @@ -125,8 +125,10 @@ pub fn get_input( let (on_winch, cleanup) = sigwinch(); let dns_client = if resolve { let mut runtime = Runtime::new()?; - let resolver = runtime.block_on(dns::Resolver::new(runtime.handle().clone())).unwrap(); - let dns_client = dns::Client::new(resolver,runtime)?; + let resolver = runtime + .block_on(dns::Resolver::new(runtime.handle().clone())) + .unwrap(); + let dns_client = dns::Client::new(resolver, runtime)?; Some(dns_client) } else { None -- cgit v1.2.3