From 670cfb36476a026dbd78ff08aa2424965a8eed61 Mon Sep 17 00:00:00 2001 From: AidanV Date: Sat, 20 Apr 2024 01:29:18 -0700 Subject: [PATCH] did some cleanup --- yazi-fm/Cargo.toml | 1 - yazi-plugin/preset/components/folder.lua | 2 +- yazi-shared/src/fs/cha.rs | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index df88240e..938159fd 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -35,7 +35,6 @@ tokio-util = "0.7.10" tracing = { version = "0.1.40", features = [ "max_level_debug", "release_max_level_warn" ] } tracing-appender = "0.2.3" tracing-subscriber = "0.3.18" -nix = "0.28.0" [target."cfg(unix)".dependencies] libc = "0.2.153" diff --git a/yazi-plugin/preset/components/folder.lua b/yazi-plugin/preset/components/folder.lua index e0db69e5..f5cbcf97 100644 --- a/yazi-plugin/preset/components/folder.lua +++ b/yazi-plugin/preset/components/folder.lua @@ -22,7 +22,7 @@ function Folder:linemode(area, files) elseif mode == "permissions" then spans[#spans + 1] = ui.Span(f.cha:permissions() or "") elseif mode == "owner" then - spans[#spans + 1] = ui.Span(f.cha.owner or "it failed") + spans[#spans + 1] = ui.Span(f.cha.owner or "") end spans[#spans + 1] = ui.Span(" ") diff --git a/yazi-shared/src/fs/cha.rs b/yazi-shared/src/fs/cha.rs index 278fc4a6..098100cc 100644 --- a/yazi-shared/src/fs/cha.rs +++ b/yazi-shared/src/fs/cha.rs @@ -84,9 +84,7 @@ impl From for Cha { }, #[cfg(unix)] owner: { - //use nix::unistd::User; use std::os::unix::fs::MetadataExt; - //from_uid(m.uid()). users::get_user_by_uid(m.uid()).unwrap().name().to_str().unwrap_or_default().to_string() + " " + users::get_group_by_gid(m.gid()).unwrap().name().to_str().unwrap_or_default() },