From d4822afc98009b305c4a4ab4315f3c920d3b9bfa Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Tue, 14 Sep 2021 12:24:04 +0900 Subject: [PATCH] meta: cargo clippy & fmt --- server/src/main.rs | 6 +++++- wgctrl-rs/src/backends/userspace.rs | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index 0eed0e0..065d4a3 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -615,7 +615,11 @@ fn get_session( .ok_or(ServerError::Unauthorized)?; let pubkey = pubkey.to_str().map_err(|_| ServerError::Unauthorized)?; let pubkey = Key::from_base64(pubkey).map_err(|_| ServerError::Unauthorized)?; - if pubkey.as_bytes().ct_eq(&context.public_key.as_bytes()).into() { + if pubkey + .as_bytes() + .ct_eq(context.public_key.as_bytes()) + .into() + { let peer = DatabasePeer::get_from_ip(&context.db.lock(), addr).map_err(|e| match e { rusqlite::Error::QueryReturnedNoRows => ServerError::Unauthorized, e => ServerError::Database(e), diff --git a/wgctrl-rs/src/backends/userspace.rs b/wgctrl-rs/src/backends/userspace.rs index 5c17f19..1478002 100644 --- a/wgctrl-rs/src/backends/userspace.rs +++ b/wgctrl-rs/src/backends/userspace.rs @@ -328,7 +328,10 @@ pub fn apply(builder: &DeviceUpdate, iface: &InterfaceName) -> io::Result<()> { } for peer in &builder.peers { - request.push_str(&format!("public_key={}\n", hex::encode(peer.public_key.as_bytes()))); + request.push_str(&format!( + "public_key={}\n", + hex::encode(peer.public_key.as_bytes()) + )); if peer.replace_allowed_ips { request.push_str("replace_allowed_ips=true\n"); @@ -506,4 +509,4 @@ mod test { assert!(key.as_bytes() != &[0u8; 32]); } } -} \ No newline at end of file +}