Skip to content

Commit

Permalink
Move 'traverse' module out of 'interactive' - it's unrelated
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thiel committed Jun 3, 2019
1 parent 84b6f8c commit fb57ebd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use crate::interactive::{widgets::SortMode, EntryData, Tree, TreeIndex};
use crate::{
interactive::widgets::SortMode,
traverse::{EntryData, Tree, TreeIndex},
};
use itertools::Itertools;
use jwalk::WalkDir;
use petgraph::Direction;
Expand Down
2 changes: 1 addition & 1 deletion src/interactive/app.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::widgets::{DisplayState, MainWindow};
use crate::{interactive::Traversal, sorted_entries, ByteFormat, WalkOptions, WalkResult};
use crate::{sorted_entries, traverse::Traversal, ByteFormat, WalkOptions, WalkResult};
use failure::Error;
use itertools::Itertools;
use petgraph::Direction;
Expand Down
2 changes: 0 additions & 2 deletions src/interactive/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
mod app;
mod traverse;
pub mod widgets;

pub use self::app::*;
pub use self::traverse::*;
8 changes: 6 additions & 2 deletions src/interactive/widgets.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
use super::{DisplayOptions, Traversal, Tree, TreeIndex};
use crate::{get_entry_or_panic, sorted_entries, ByteFormat};
use super::DisplayOptions;
use crate::{
get_entry_or_panic, sorted_entries,
traverse::{Traversal, Tree, TreeIndex},
ByteFormat,
};
use std::path::PathBuf;
use tui::layout::{Constraint, Direction, Layout};
use tui::style::{Color, Style};
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ extern crate jwalk;

mod aggregate;
mod common;

pub mod interactive;
pub mod traverse;

pub use aggregate::aggregate;
pub use common::*;
File renamed without changes.
3 changes: 1 addition & 2 deletions tests/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ mod app {
app.process_events(&mut terminal, b"ju".keys())?;
{
assert_eq!(
app.traversal.root_index,
app.state.root,
app.traversal.root_index, app.state.root,
"it keeps the root - it can't go further up"
);
assert_eq!(
Expand Down

0 comments on commit fb57ebd

Please sign in to comment.