summaryrefslogtreecommitdiffstats
path: root/src/tree.rs
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2023-11-07 09:45:52 +0100
committerqkzk <qu3nt1n@gmail.com>2023-11-07 09:45:52 +0100
commit64b3564b51d359010fcd339d762290f08ee91dba (patch)
tree506b04f3f29decad59bcf90c5add7167593a7d2e /src/tree.rs
parent17b59cce5ecddf6f7c6609a5680f3486649932d6 (diff)
don't use public attributes in nodes
Diffstat (limited to 'src/tree.rs')
-rw-r--r--src/tree.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/tree.rs b/src/tree.rs
index aee8312..1c58f8d 100644
--- a/src/tree.rs
+++ b/src/tree.rs
@@ -38,10 +38,10 @@ impl ColoredString {
#[derive(Debug, Clone)]
pub struct Node {
- pub path: PathBuf,
- pub children: Option<Vec<PathBuf>>,
- pub folded: bool,
- pub selected: bool,
+ path: PathBuf,
+ children: Option<Vec<PathBuf>>,
+ folded: bool,
+ selected: bool,
}
impl Node {
@@ -74,6 +74,10 @@ impl Node {
self.selected = false
}
+ pub fn selected(&self) -> bool {
+ self.selected
+ }
+
pub fn fileinfo(&self, users: &Users) -> Result<FileInfo> {
FileInfo::new(&self.path, users)
}