Skip to content

Commit

Permalink
Merge pull request #34 from hexedtech/fix/sorted-tree
Browse files Browse the repository at this point in the history
feat: sort filetree before returning it
  • Loading branch information
alemidev authored Sep 30, 2024
2 parents f03995c + 3a9fdeb commit 5e2e711
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ impl Workspace {
/// A filter may be applied, and it may be strict (equality check) or not (starts_with check).
// #[cfg_attr(feature = "js", napi)] // https://github.com/napi-rs/napi-rs/issues/1120
pub fn filetree(&self, filter: Option<&str>, strict: bool) -> Vec<String> {
self.0
let mut tree = self.0
.filetree
.iter()
.filter(|f| {
Expand All @@ -299,7 +299,9 @@ impl Workspace {
})
})
.map(|f| f.clone())
.collect()
.collect::<Vec<String>>();
tree.sort();
tree
}

pub(crate) fn run_actor(
Expand Down

0 comments on commit 5e2e711

Please sign in to comment.