feat: sort filetree before returning it

This commit is contained in:
əlemi 2024-09-30 20:30:55 +02:00
parent f03995c9d6
commit 3a9fdebbc0
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -286,7 +286,7 @@ impl Workspace {
/// A filter may be applied, and it may be strict (equality check) or not (starts_with check). /// 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 // #[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> { pub fn filetree(&self, filter: Option<&str>, strict: bool) -> Vec<String> {
self.0 let mut tree = self.0
.filetree .filetree
.iter() .iter()
.filter(|f| { .filter(|f| {
@ -299,7 +299,9 @@ impl Workspace {
}) })
}) })
.map(|f| f.clone()) .map(|f| f.clone())
.collect() .collect::<Vec<String>>();
tree.sort();
tree
} }
pub(crate) fn run_actor( pub(crate) fn run_actor(