Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test and example build warnings on stable Rust #315

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -1922,8 +1926,7 @@ fn as_file_kind(mut mode: u32) -> FileKind {
}

fn get_groups(pid: u32) -> Vec<u32> {
#[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() {
Expand Down
4 changes: 2 additions & 2 deletions src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
9 changes: 7 additions & 2 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {}

Expand Down