[pbs-devel] [PATCH proxmox v2 10/18] shared-memory: remove unneeded generic parameter

Maximiliano Sandoval m.sandoval at proxmox.com
Wed Jun 26 14:43:38 CEST 2024


Fixes the clippy warning:

warning: type parameter `T` goes unused in function definition
  --> proxmox-shared-memory/tests/raw_shared_mutex.rs:80:19
   |
80 | fn create_test_dir<T: Init>(filename: &str) -> Option<PathBuf> {
   |                   ^^^^^^^^^ help: consider removing the parameter
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
   = note: `#[warn(clippy::extra_unused_type_parameters)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 proxmox-shared-memory/tests/raw_shared_mutex.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxmox-shared-memory/tests/raw_shared_mutex.rs b/proxmox-shared-memory/tests/raw_shared_mutex.rs
index fff37c0c..7608377e 100644
--- a/proxmox-shared-memory/tests/raw_shared_mutex.rs
+++ b/proxmox-shared-memory/tests/raw_shared_mutex.rs
@@ -77,7 +77,7 @@ impl Init for MultiMutexData {
     }
 }
 
-fn create_test_dir<T: Init>(filename: &str) -> Option<PathBuf> {
+fn create_test_dir(filename: &str) -> Option<PathBuf> {
     let test_dir: String = env!("CARGO_TARGET_TMPDIR").to_string();
 
     let mut path = PathBuf::from(&test_dir);
@@ -100,7 +100,7 @@ fn create_test_dir<T: Init>(filename: &str) -> Option<PathBuf> {
 }
 #[test]
 fn test_shared_memory_mutex() -> Result<(), Error> {
-    let path = match create_test_dir::<SingleMutexData>("data1.shm") {
+    let path = match create_test_dir("data1.shm") {
         None => {
             return Ok(()); // no O_TMPFILE support, can't run test
         }
@@ -138,7 +138,7 @@ fn test_shared_memory_mutex() -> Result<(), Error> {
 
 #[test]
 fn test_shared_memory_multi_mutex() -> Result<(), Error> {
-    let path = match create_test_dir::<SingleMutexData>("data2.shm") {
+    let path = match create_test_dir("data2.shm") {
         None => {
             return Ok(()); // no O_TMPFILE support, can't run test
         }
-- 
2.39.2





More information about the pbs-devel mailing list