From c618d7949b4b07939cf6dfc18d2ae9292f5e6e0c Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Mon, 13 Sep 2021 00:48:49 +0900 Subject: [PATCH] meta: cargo update && cargo fmt --- Cargo.lock | 4 ++-- client/src/data_store.rs | 4 +++- client/src/main.rs | 6 ++++-- server/src/db/peer.rs | 5 ++++- server/src/test.rs | 11 ++++------- shared/src/lib.rs | 8 +++++++- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 79c5e82..c7cd0c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1183,9 +1183,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338" +checksum = "5241dd6f21443a3606b432718b166d3cedc962fd4b8bea54a8bc7f514ebda986" dependencies = [ "tinyvec_macros", ] diff --git a/client/src/data_store.rs b/client/src/data_store.rs index 6c7e866..d36a9f1 100644 --- a/client/src/data_store.rs +++ b/client/src/data_store.rs @@ -1,7 +1,9 @@ use crate::Error; use anyhow::bail; use serde::{Deserialize, Serialize}; -use shared::{CLIENT_DATA_DIR, Cidr, IoErrorContext, Peer, WrappedIoError, chmod, ensure_dirs_exist}; +use shared::{ + chmod, ensure_dirs_exist, Cidr, IoErrorContext, Peer, WrappedIoError, CLIENT_DATA_DIR, +}; use std::{ fs::{File, OpenOptions}, io::{self, Read, Seek, SeekFrom, Write}, diff --git a/client/src/main.rs b/client/src/main.rs index b318711..15f4880 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -384,7 +384,8 @@ fn install( interface = iface.to_string().yellow(), daemon_mode = "innernet up -d --interval 60".yellow()); } else { - eprintdoc!(" + eprintdoc!( + " It's recommended to now keep the interface automatically refreshing via whatever service system your distribution provides. @@ -393,7 +394,8 @@ fn install( {daemon_mode} {interface} ", interface = iface.to_string().yellow(), - daemon_mode = "innernet up -d --interval 60".yellow()); + daemon_mode = "innernet up -d --interval 60".yellow() + ); } Ok(()) } diff --git a/server/src/db/peer.rs b/server/src/db/peer.rs index ba005ff..7abce7f 100644 --- a/server/src/db/peer.rs +++ b/server/src/db/peer.rs @@ -103,7 +103,10 @@ impl DatabasePeer { } if !cidr.cidr.is_assignable(*ip) { - println!("Peer IP {} is not unicast assignable in CIDR {}", ip, cidr.cidr); + println!( + "Peer IP {} is not unicast assignable in CIDR {}", + ip, cidr.cidr + ); return Err(ServerError::InvalidQuery); } diff --git a/server/src/test.rs b/server/src/test.rs index 4cb611b..cff4325 100644 --- a/server/src/test.rs +++ b/server/src/test.rs @@ -191,13 +191,10 @@ impl Server { } else { format!("http://{}{}", WG_MANAGE_PEER_IP, path) }; - Request::builder() - .uri(path) - .method(verb) - .header( - shared::INNERNET_PUBKEY_HEADER, - HeaderValue::from_str(&self.public_key.to_base64()).unwrap(), - ) + Request::builder().uri(path).method(verb).header( + shared::INNERNET_PUBKEY_HEADER, + HeaderValue::from_str(&self.public_key.to_base64()).unwrap(), + ) } pub async fn request(&self, ip_str: &str, verb: &str, path: &str) -> Response { diff --git a/shared/src/lib.rs b/shared/src/lib.rs index 402cb6d..b399ab6 100644 --- a/shared/src/lib.rs +++ b/shared/src/lib.rs @@ -1,6 +1,12 @@ pub use anyhow::Error; use lazy_static::lazy_static; -use std::{fs::{self, File, Permissions}, io, os::unix::fs::PermissionsExt, path::Path, time::Duration}; +use std::{ + fs::{self, File, Permissions}, + io, + os::unix::fs::PermissionsExt, + path::Path, + time::Duration, +}; pub mod interface_config; #[cfg(target_os = "linux")]