mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
refactor: remove the warning of unused variable, fix #300
This commit is contained in:
parent
2df1dae5af
commit
52e0746f30
1 changed files with 52 additions and 52 deletions
|
|
@ -92,13 +92,14 @@ pub fn copy_with_progress(from: &Path, to: &Path) -> mpsc::Receiver<Result<u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert a file mode to a string representation
|
// Convert a file mode to a string representation
|
||||||
|
#[cfg(windows)]
|
||||||
|
#[allow(clippy::collapsible_else_if)]
|
||||||
|
pub fn permissions(_: Permissions) -> Option<String> { None }
|
||||||
|
|
||||||
|
// Convert a file mode to a string representation
|
||||||
|
#[cfg(unix)]
|
||||||
#[allow(clippy::collapsible_else_if)]
|
#[allow(clippy::collapsible_else_if)]
|
||||||
pub fn permissions(permissions: Permissions) -> Option<String> {
|
pub fn permissions(permissions: Permissions) -> Option<String> {
|
||||||
#[cfg(windows)]
|
|
||||||
return None;
|
|
||||||
|
|
||||||
#[cfg(unix)]
|
|
||||||
Some({
|
|
||||||
use std::os::unix::prelude::PermissionsExt;
|
use std::os::unix::prelude::PermissionsExt;
|
||||||
|
|
||||||
use libc::{S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK, S_IFMT, S_IFSOCK, S_IRGRP, S_IROTH, S_IRUSR, S_ISGID, S_ISUID, S_ISVTX, S_IWGRP, S_IWOTH, S_IWUSR, S_IXGRP, S_IXOTH, S_IXUSR};
|
use libc::{S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK, S_IFMT, S_IFSOCK, S_IRGRP, S_IROTH, S_IRUSR, S_ISGID, S_ISUID, S_ISVTX, S_IWGRP, S_IWOTH, S_IWUSR, S_IXGRP, S_IXOTH, S_IXUSR};
|
||||||
|
|
@ -152,8 +153,7 @@ pub fn permissions(permissions: Permissions) -> Option<String> {
|
||||||
if m & S_ISVTX != 0 { 'T' } else { '-' }
|
if m & S_ISVTX != 0 { 'T' } else { '-' }
|
||||||
});
|
});
|
||||||
|
|
||||||
s
|
Some(s)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the max common root of a list of files
|
// Find the max common root of a list of files
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue