Skip to content

Commit

Permalink
Moved tree::progress::* back into crate::progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 10, 2020
1 parent 4e38c6b commit cf7405c
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### Breaking

* In `Progress::init(max, unit)` , `unit` now is `Option<Unit>`, existing code can be transformed using `progress.init(None, Some("label".into()))`.
* moved `tree::progress` into `progress` and renamed `Value` into `Task` and `Progress` into `Value`
* **removed** `deep_eq()` method in `Root` tree
* tui engine option `redraw_only_on_state_change` was removed without substitute
* **Move and rename**
Expand Down
3 changes: 2 additions & 1 deletion src/render/line/draw.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{
tree::{self, progress, Progress},
progress::{self, Progress},
tree::{self},
unit,
};
use crosstermion::{
Expand Down
3 changes: 2 additions & 1 deletion src/render/tui/draw/all.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::{
progress::Value,
render::tui::{
draw,
utils::{block_width, rect},
InterruptDrawInfo, Line,
},
tree::{self, progress::Value, Key, Message},
tree::{self, Key, Message},
};
use std::time::Duration;
use tui::{
Expand Down
7 changes: 2 additions & 5 deletions src/render/tui/draw/progress.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{
progress::{self, Progress, Step, Value},
render::tui::{
draw::State,
utils::{
Expand All @@ -8,11 +9,7 @@ use crate::{
InterruptDrawInfo,
},
time::format_now_datetime_seconds,
tree::{
self,
progress::{self, Step, Value},
Key, Progress,
},
tree::{self, Key},
unit,
};
use humantime::format_duration;
Expand Down
7 changes: 2 additions & 5 deletions src/tree/item.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use crate::{
tree::{
messages::MessageRingBuffer,
progress::{Progress, State, Step, Value},
Key, MessageLevel,
},
progress::{Progress, State, Step, Value},
tree::{messages::MessageRingBuffer, Key, MessageLevel},
unit::Unit,
};
use dashmap::DashMap;
Expand Down
2 changes: 1 addition & 1 deletion src/tree/key.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{tree::item, tree::progress::Value};
use crate::{progress::Value, tree::item};
use std::ops::{Index, IndexMut};

// NOTE: This means we will show weird behaviour if there are more than 2^16 tasks at the same time on a level
Expand Down
3 changes: 0 additions & 3 deletions src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ mod throughput;
pub use throughput::Throughput;

pub mod key;
pub mod progress;
#[doc(inline)]
pub use progress::Progress;

#[doc(inline)]
pub use key::{Key, Level};
2 changes: 0 additions & 2 deletions src/tree/progress.rs

This file was deleted.

5 changes: 4 additions & 1 deletion src/tree/root.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use crate::tree::{messages::MessageRingBuffer, progress::Value, Item, Key, Message, MessageCopyState};
use crate::{
progress::Value,
tree::{messages::MessageRingBuffer, Item, Key, Message, MessageCopyState},
};
use dashmap::DashMap;
use parking_lot::Mutex;
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion src/tree/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ mod message_buffer {

mod key_adjacency {
use crate::{
progress::Value,
tree::key::SiblingLocation::*,
tree::progress::Value,
tree::{key::Adjacency, Key},
};

Expand Down
5 changes: 4 additions & 1 deletion src/tree/throughput.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use crate::{tree, tree::progress, tree::Progress, unit};
use crate::{
progress::{self, Progress},
tree, unit,
};
use std::time::{Duration, SystemTime};

const THROTTLE_INTERVAL: Duration = Duration::from_secs(1);
Expand Down
2 changes: 1 addition & 1 deletion src/unit/bytes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{tree::progress::Step, unit::DisplayValue};
use crate::{progress::Step, unit::DisplayValue};
use std::fmt;

#[derive(Copy, Clone, Default, Eq, PartialEq, Ord, PartialOrd, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/unit/display.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
tree::progress::Step,
progress::Step,
unit::{DisplayValue, Unit},
};
use std::fmt::{self, Write};
Expand Down
2 changes: 1 addition & 1 deletion src/unit/duration.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{tree::progress::Step, unit::DisplayValue};
use crate::{progress::Step, unit::DisplayValue};
use std::fmt;

#[derive(Copy, Clone, Default, Eq, PartialEq, Ord, PartialOrd, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/unit/human.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{tree::progress::Step, unit::DisplayValue};
use crate::{progress::Step, unit::DisplayValue};
pub use human_format::{Formatter, Scales};
use std::fmt;

Expand Down
2 changes: 1 addition & 1 deletion src/unit/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::tree::progress::Step;
use crate::progress::Step;
use std::{fmt, ops::Deref, sync::Arc};

#[cfg(feature = "unit-bytes")]
Expand Down
2 changes: 1 addition & 1 deletion src/unit/range.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{tree::progress::Step, unit::DisplayValue};
use crate::{progress::Step, unit::DisplayValue};
use std::fmt;

#[derive(Copy, Clone, Default, Eq, PartialEq, Ord, PartialOrd, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/unit/traits.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{tree::progress::Step, unit::display};
use crate::{progress::Step, unit::display};
use std::fmt;

pub trait DisplayValue {
Expand Down

0 comments on commit cf7405c

Please sign in to comment.