From e96b5feaf2cca97986ce305d1221d6e8868d0897 Mon Sep 17 00:00:00 2001 From: Riccardo Zaglia Date: Sat, 14 Oct 2023 23:57:59 +0800 Subject: [PATCH] refactor: :rotating_light: Fix some lints --- alvr/client_core/build.rs | 4 ++-- alvr/server/src/c_api.rs | 2 ++ alvr/server/src/lib.rs | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/alvr/client_core/build.rs b/alvr/client_core/build.rs index 1b0cd9869d..d536b89666 100644 --- a/alvr/client_core/build.rs +++ b/alvr/client_core/build.rs @@ -14,12 +14,12 @@ fn main() { let source_files_paths = cpp_paths .iter() - .filter_map(|path| { + .filter(|&path| { path.extension() .filter(|ext| ext.to_string_lossy() == "cpp") .is_some() - .then(|| path.clone()) }) + .cloned() .collect::>(); cc::Build::new() diff --git a/alvr/server/src/c_api.rs b/alvr/server/src/c_api.rs index e78a106107..9c81bf4967 100644 --- a/alvr/server/src/c_api.rs +++ b/alvr/server/src/c_api.rs @@ -1,3 +1,5 @@ +#![allow(dead_code, unused_variables)] + use ash::vk; use std::{ ffi::{c_char, CStr}, diff --git a/alvr/server/src/lib.rs b/alvr/server/src/lib.rs index b970ad559e..386c109edf 100644 --- a/alvr/server/src/lib.rs +++ b/alvr/server/src/lib.rs @@ -147,13 +147,13 @@ pub extern "C" fn shutdown_driver() { let hostnames = data_manager_lock .client_list() .iter() - .filter_map(|(hostname, info)| { - (!matches!( + .filter(|&(_, info)| { + !matches!( info.connection_state, ConnectionState::Disconnected | ConnectionState::Disconnecting { .. } - )) - .then(|| hostname.clone()) + ) }) + .map(|(hostname, _)| hostname.clone()) .collect::>(); for hostname in hostnames {