From a5d88830ca25720cc885a9aba2105220ad3625b3 Mon Sep 17 00:00:00 2001 From: Daniel Carl Jones Date: Wed, 20 Nov 2024 15:05:26 +0000 Subject: [PATCH] Fix warnings on stable Rust --- Cargo.toml | 2 +- examples/simple.rs | 7 +++++-- src/request.rs | 4 ++-- tests/integration_tests.rs | 9 +++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 737586f8..93befc3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,7 +77,7 @@ required-features = ["abi-7-12"] [[example]] name = "notify_inval_inode" -required-features = ["abi-7-12"] +required-features = ["abi-7-15"] [[example]] name = "ioctl" diff --git a/examples/simple.rs b/examples/simple.rs index 12469f38..0c092855 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1098,6 +1098,10 @@ impl Filesystem for SimpleFS { flags: u32, reply: ReplyEmpty, ) { + debug!( + "rename() called with: source {parent:?} {name:?}, \ + destination {new_parent:?} {new_name:?}, flags {flags:#b}", + ); let mut inode_attrs = match self.lookup_name(parent, name) { Ok(attrs) => attrs, Err(error_code) => { @@ -1922,8 +1926,7 @@ fn as_file_kind(mut mode: u32) -> FileKind { } fn get_groups(pid: u32) -> Vec { - #[cfg(not(target_os = "macos"))] - { + if cfg!(not(target_os = "macos")) { let path = format!("/proc/{pid}/task/{pid}/status"); let file = File::open(path).unwrap(); for line in BufReader::new(file).lines() { diff --git a/src/request.rs b/src/request.rs index c2de185a..e25a4c64 100644 --- a/src/request.rs +++ b/src/request.rs @@ -615,9 +615,9 @@ impl<'a> Request<'a> { se.filesystem.setvolname(self, x.name(), self.reply()); } #[cfg(target_os = "macos")] - ll::Operation::GetXTimes(_) => { + ll::Operation::GetXTimes(x) => { se.filesystem - .getxtimes(self, self.request.nodeid().into(), self.reply()); + .getxtimes(self, x.nodeid().into(), self.reply()); } #[cfg(target_os = "macos")] ll::Operation::Exchange(x) => { diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 0ed8c804..0bbc8451 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,3 +1,6 @@ +// No integration tests for non-Linux targets, so turn off the module for now. +#![cfg(target_os = "linux")] + use fuser::{Filesystem, Session}; use std::rc::Rc; use std::thread; @@ -7,8 +10,10 @@ use tempfile::TempDir; #[test] #[cfg(target_os = "linux")] fn unmount_no_send() { - // Rc to make this !Send - struct NoSendFS(Rc<()>); + struct NoSendFS( + // Rc to make this !Send + #[allow(dead_code)] Rc<()>, + ); impl Filesystem for NoSendFS {}