diff --git a/cap-primitives/src/rustix/fs/dir_entry_inner.rs b/cap-primitives/src/rustix/fs/dir_entry_inner.rs index 5fc7811e..cba5238e 100644 --- a/cap-primitives/src/rustix/fs/dir_entry_inner.rs +++ b/cap-primitives/src/rustix/fs/dir_entry_inner.rs @@ -69,7 +69,8 @@ impl DirEntryInner { #[inline] pub(crate) fn is_same_file(&self, metadata: &Metadata) -> io::Result { - Ok(self.ino() == metadata.ino() && self.metadata()?.dev() == metadata.dev()) + let self_md = self.metadata()?; + Ok(self_md.ino() == metadata.ino() && self_md.dev() == metadata.dev()) } fn file_name_bytes(&self) -> &OsStr {