summaryrefslogtreecommitdiffstats
path: root/src/interactive/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/interactive/app.rs')
-rw-r--r--src/interactive/app.rs27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/interactive/app.rs b/src/interactive/app.rs
index 7418579..b939074 100644
--- a/src/interactive/app.rs
+++ b/src/interactive/app.rs
@@ -1,8 +1,11 @@
use crate::{
interactive::widgets::{DrawState, HelpPaneState, MainWindow},
+ ByteFormat,
+};
+use dua::{
path_of, sorted_entries,
traverse::{Traversal, TreeIndex},
- ByteFormat, WalkOptions, WalkResult,
+ SortMode, WalkOptions, WalkResult,
};
use failure::Error;
use itertools::Itertools;
@@ -11,28 +14,6 @@ use std::{fmt, io, path::PathBuf};
use termion::input::{Keys, TermReadEventsAndRaw};
use tui::{backend::Backend, widgets::Widget, Terminal};
-#[derive(Debug, Copy, Clone, PartialOrd, PartialEq, Eq)]
-pub enum SortMode {
- SizeDescending,
- SizeAscending,
-}
-
-impl SortMode {
- pub fn toggle_size(&mut self) {
- use SortMode::*;
- *self = match self {
- SizeAscending => SizeDescending,
- SizeDescending => SizeAscending,
- }
- }
-}
-
-impl Default for SortMode {
- fn default() -> Self {
- SortMode::SizeDescending
- }
-}
-
#[derive(Clone, Copy)]
pub enum ByteVisualization {
Percentage,