Update DirRead to sort returned paths by name

pull/38/head v0.9.3
Chip Senkbeil 3 years ago
parent 0ffbc8db2f
commit 1a1f219594
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

2
Cargo.lock generated

@ -179,7 +179,7 @@ dependencies = [
[[package]]
name = "distant"
version = "0.9.2"
version = "0.9.3"
dependencies = [
"bytes",
"derive_more",

@ -2,7 +2,7 @@
name = "distant"
description = "Operate on a remote computer through file and process manipulation"
categories = ["command-line-utilities"]
version = "0.9.2"
version = "0.9.3"
authors = ["Chip Senkbeil <chip@senkbeil.org>"]
edition = "2018"
homepage = "https://github.com/chipsenkbeil/distant"

@ -135,7 +135,9 @@ async fn dir_read(
// Traverse, but don't include root directory in entries (hence min depth 1), unless indicated
// to do so (min depth 0)
let dir = WalkDir::new(root_path.as_path()).min_depth(if include_root { 0 } else { 1 });
let dir = WalkDir::new(root_path.as_path())
.min_depth(if include_root { 0 } else { 1 })
.sort_by_file_name();
// If depth > 0, will recursively traverse to specified max depth, otherwise
// performs infinite traversal

Loading…
Cancel
Save