diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-01-31 16:02:22 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-01-31 16:02:22 +0100 |
commit | 8a79377013e60930eb0af68a16e96c19a6abec1c (patch) | |
tree | b41904a83ce91bc049d05cfc074cbe20e13dd0d8 /src/tree.rs | |
parent | 16016112acbc7861af1cc2d050f47e46f19749e0 (diff) |
remove all Rc to users cache. Use simple reference only
Diffstat (limited to 'src/tree.rs')
-rw-r--r-- | src/tree.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/tree.rs b/src/tree.rs index fc79ad9..2461fb5 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -1,5 +1,4 @@ use std::path::Path; -use std::rc::Rc; use tuikit::attr::Attr; use users::UsersCache; @@ -130,7 +129,7 @@ impl Tree { pub fn from_path( path: &Path, max_depth: usize, - users_cache: &Rc<UsersCache>, + users_cache: &UsersCache, filter_kind: &FilterKind, show_hidden: bool, parent_position: Vec<usize>, @@ -160,7 +159,7 @@ impl Tree { fn create_tree_from_fileinfo( fileinfo: FileInfo, max_depth: usize, - users_cache: &Rc<UsersCache>, + users_cache: &UsersCache, filter_kind: &FilterKind, display_hidden: bool, parent_position: Vec<usize>, @@ -190,7 +189,7 @@ impl Tree { fn make_leaves( fileinfo: &FileInfo, max_depth: usize, - users_cache: &Rc<UsersCache>, + users_cache: &UsersCache, display_hidden: bool, filter_kind: &FilterKind, sort_kind: &SortKind, @@ -236,7 +235,7 @@ impl Tree { /// Creates an empty tree. Used when the user changes the CWD and hasn't displayed /// a tree yet. - pub fn empty(path: &Path, users_cache: &Rc<UsersCache>) -> FmResult<Self> { + pub fn empty(path: &Path, users_cache: &UsersCache) -> FmResult<Self> { let filename = filename_from_path(path)?; let fileinfo = FileInfo::from_path_with_name(path, filename, users_cache)?; let node = Node { |