From 3a9fdebbc0f6bf4ba22b57c370925fa3b286f96d Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 30 Sep 2024 20:30:55 +0200 Subject: [PATCH] feat: sort filetree before returning it --- src/workspace.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/workspace.rs b/src/workspace.rs index c4c1d9e..4f3b63c 100644 --- a/src/workspace.rs +++ b/src/workspace.rs @@ -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 { - self.0 + let mut tree = self.0 .filetree .iter() .filter(|f| { @@ -299,7 +299,9 @@ impl Workspace { }) }) .map(|f| f.clone()) - .collect() + .collect::>(); + tree.sort(); + tree } pub(crate) fn run_actor(