Skip to content

Commit

Permalink
refactor: reorder members
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Aug 31, 2022
1 parent 8473dfa commit 0a63133
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ pub use identifier::{
#[derive(Debug, Default, Clone)]
pub struct TreeState {
offset: usize,
selected: TreeIdentifierVec,
opened: HashSet<TreeIdentifierVec>,
selected: TreeIdentifierVec,
}

impl TreeState {
pub const fn get_offset(&self) -> usize {
self.offset
}

pub fn get_all_opened(&self) -> Vec<TreeIdentifierVec> {
self.opened.iter().cloned().collect()
}

pub fn selected(&self) -> Vec<usize> {
self.selected.clone()
}
Expand Down Expand Up @@ -71,14 +79,6 @@ impl TreeState {
pub fn close_all(&mut self) {
self.opened.clear();
}

pub fn get_all_opened(&self) -> Vec<TreeIdentifierVec> {
self.opened.iter().cloned().collect()
}

pub const fn get_offset(&self) -> usize {
self.offset
}
}

#[derive(Debug, Clone)]
Expand Down

0 comments on commit 0a63133

Please sign in to comment.