Skip to content

Commit

Permalink
Fix warnings on stable Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycjones committed Nov 21, 2024
1 parent e18bd9b commit a7a5221
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
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

0 comments on commit a7a5221

Please sign in to comment.