meta: cargo update && cargo fmt

pull/151/head
Jake McGinty 2021-09-13 00:48:49 +09:00
parent 42eb0a7589
commit c618d7949b
6 changed files with 24 additions and 14 deletions

4
Cargo.lock generated
View File

@ -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",
]

View File

@ -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},

View File

@ -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(())
}

View File

@ -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);
}

View File

@ -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<Body> {

View File

@ -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")]