mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-24 16:14:48 +01:00
feat: sort filetree before returning it
This commit is contained in:
parent
f03995c9d6
commit
3a9fdebbc0
1 changed files with 4 additions and 2 deletions
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue