Adapt ignored workspace attributes to Rust 1.97 lint

This commit is contained in:
ms2k 2026-08-03 22:49:14 +09:00
commit aef24440a5
2 changed files with 5 additions and 5 deletions

View file

@ -449,10 +449,10 @@ impl IgnoredWorkspace {
} }
fn attributes(&self, entry: &ResolvedEntry) -> io::Result<FileAttr> { fn attributes(&self, entry: &ResolvedEntry) -> io::Result<FileAttr> {
self.attributes_for_inode(self.inode_for(entry), entry.stat) Self::attributes_for_inode(self.inode_for(entry), entry.stat)
} }
fn attributes_for_inode(&self, inode: INodeNo, stat: rustix::fs::Stat) -> io::Result<FileAttr> { fn attributes_for_inode(inode: INodeNo, stat: rustix::fs::Stat) -> io::Result<FileAttr> {
Ok(FileAttr { Ok(FileAttr {
ino: inode, ino: inode,
size: u64::try_from(stat.st_size) size: u64::try_from(stat.st_size)

View file

@ -57,12 +57,12 @@ impl Filesystem for IgnoredWorkspace {
let result = if let Some(handle) = handle { let result = if let Some(handle) = handle {
self.with_file(handle, |open| { self.with_file(handle, |open| {
let stat = fstat(open.file.as_fd())?; let stat = fstat(open.file.as_fd())?;
self.attributes_for_inode(inode, stat) Self::attributes_for_inode(inode, stat)
}) })
} else if let Some(open) = self.open_file_for_inode(inode) { } else if let Some(open) = self.open_file_for_inode(inode) {
fstat(open.file.as_fd()) fstat(open.file.as_fd())
.map_err(Into::into) .map_err(Into::into)
.and_then(|stat| self.attributes_for_inode(inode, stat)) .and_then(|stat| Self::attributes_for_inode(inode, stat))
} else { } else {
self.path_for(inode).and_then(|path| { self.path_for(inode).and_then(|path| {
let snapshot = self.classifier.snapshot_for(&path); let snapshot = self.classifier.snapshot_for(&path);
@ -123,7 +123,7 @@ impl Filesystem for IgnoredWorkspace {
)?; )?;
} }
self.record_changed(open.backing, &open.path); self.record_changed(open.backing, &open.path);
self.attributes_for_inode(inode, fstat(open.file.as_fd())?) Self::attributes_for_inode(inode, fstat(open.file.as_fd())?)
}; };
let result = if let Some(handle) = handle { let result = if let Some(handle) = handle {
self.with_file(handle, operation) self.with_file(handle, operation)