From 7b6afadb0a75493d927661484ab6f5b08bf36c9e Mon Sep 17 00:00:00 2001 From: Jeff Hiner <37913568+jeff-hiner@users.noreply.github.com> Date: Wed, 11 May 2022 12:23:07 -0600 Subject: [PATCH] Adjust gitignore, fix clippy lints (#257) * Add .vscode to .gitignore * Fix clippy lints --- .gitignore | 1 + boringtun-cli/src/main.rs | 2 +- boringtun/src/device/drop_privileges.rs | 2 +- boringtun/src/device/mod.rs | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 53eaa21..b4e53ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target **/*.rs.bk +.vscode/ diff --git a/boringtun-cli/src/main.rs b/boringtun-cli/src/main.rs index 03fa663..3b185c5 100644 --- a/boringtun-cli/src/main.rs +++ b/boringtun-cli/src/main.rs @@ -153,7 +153,7 @@ fn main() { use_multi_queue: !matches.is_present("disable-multi-queue"), }; - let mut device_handle: DeviceHandle = match DeviceHandle::new(&tun_name, config) { + let mut device_handle: DeviceHandle = match DeviceHandle::new(tun_name, config) { Ok(d) => d, Err(e) => { // Notify parent that tunnel initialization failed diff --git a/boringtun/src/device/drop_privileges.rs b/boringtun/src/device/drop_privileges.rs index 7784623..76a613c 100644 --- a/boringtun/src/device/drop_privileges.rs +++ b/boringtun/src/device/drop_privileges.rs @@ -32,7 +32,7 @@ pub fn get_saved_ids() -> Result<(uid_t, gid_t), Error> { // Saved user ID let saved_uid = unsafe { (*userinfo).pw_uid }; - return Ok((saved_uid, saved_gid)); + Ok((saved_uid, saved_gid)) } } diff --git a/boringtun/src/device/mod.rs b/boringtun/src/device/mod.rs index dd96e06..6d370e1 100644 --- a/boringtun/src/device/mod.rs +++ b/boringtun/src/device/mod.rs @@ -325,7 +325,7 @@ impl Device { ) .unwrap(); - let peer = Peer::new(tunn, next_index, endpoint, &allowed_ips, preshared_key); + let peer = Peer::new(tunn, next_index, endpoint, allowed_ips, preshared_key); let peer = Arc::new(peer); self.peers.insert(pub_key, Arc::clone(&peer));