summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgnacio Nunez <nacho@ownyourbits.com>2018-06-20 12:55:00 +0200
committerIgnacio Nunez <nacho@ownyourbits.com>2018-07-01 22:56:08 +0200
commitb047cbf8f1297a0d916b8c3365d45bf4238b45f4 (patch)
treef2281edf77587c02e73262e08936bd5a6ab618ea
parent98470a8afc14b80ac5c64d13bfe14323d9387682 (diff)
fix ordering in collectionsv0.2.8
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/lib.rs3
3 files changed, 4 insertions, 3 deletions
diff --git a/Cargo.lock b/Cargo.lock
index b9a4a6c..e542844 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8,7 +8,7 @@ dependencies = [
[[package]]
name = "dutree"
-version = "0.2.4"
+version = "0.2.8"
dependencies = [
"getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/Cargo.toml b/Cargo.toml
index 439acea..b7a5532 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "dutree"
-version = "0.2.7"
+version = "0.2.8"
authors = ["nacho <nacho@ownyourbits.com>"]
description = "Command line tool to analyze disk usage"
repository = "https://github.com/nachoparker/dutree"
diff --git a/src/lib.rs b/src/lib.rs
index f479a60..ff83244 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -59,7 +59,7 @@ use std::os::unix::fs::MetadataExt;
use std::env;
use std::collections::HashMap;
-const VERSTR : &str = "v0.2.7";
+const VERSTR : &str = "v0.2.8";
const DEF_WIDTH : u16 = 80;
pub enum XResult<T,S> {
@@ -562,6 +562,7 @@ pub fn run( cfg: &Config ) {
bytes += e.bytes;
entries.push( e );
}
+ entries.sort_unstable_by( |a, b| b.bytes.cmp( &a.bytes ) );
let len = entries.len();
if len > 0 {
entries[len-1].last = true;