Showing the changes to git-features/src/progress (1 of 2 files). Show all
Unified · Split
| @@ -3,12 +3,15 @@ use std::io; · 2 unmodified lines | |||
| 3 | pub use prodash::progress::{Discard, DoOrDiscard, Either, ThroughputOnDrop}; | 3 | pub use prodash::progress::{Discard, DoOrDiscard, Either, ThroughputOnDrop}; |
| 4 | pub use prodash::{unit, Progress, Unit}; | 4 | pub use prodash::{unit, Progress, Unit}; |
| 5 | 5 | ||
| 6 | pub fn bytes() -> Unit { | 6 | pub fn bytes() -> Option<Unit> { |
| 7 | unit::dynamic_and_mode(unit::Bytes, unit::display::Mode::with_throughput().and_percentage()) | 7 | Some(unit::dynamic_and_mode( |
| 8 | unit::Bytes, | ||
| 9 | unit::display::Mode::with_throughput().and_percentage(), | ||
| 10 | )) | ||
| 8 | } | 11 | } |
| 9 | 12 | ||
| 10 | pub fn count(name: &'static str) -> Unit { | 13 | pub fn count(name: &'static str) -> Option<Unit> { |
| 11 | unit::dynamic_and_mode( | 14 | Some(unit::dynamic_and_mode( |
| 12 | unit::Human::new( | 15 | unit::Human::new( |
| 13 | { | 16 | { |
| 14 | let mut f = unit::human::Formatter::new(); | 17 | let mut f = unit::human::Formatter::new(); |
| @@ -18,11 +21,11 @@ pub fn count(name: &'static str) -> Unit { · 3 unmodified lines | |||
| 18 | name, | 21 | name, |
| 19 | ), | 22 | ), |
| 20 | unit::display::Mode::with_throughput().and_percentage(), | 23 | unit::display::Mode::with_throughput().and_percentage(), |
| 21 | ) | 24 | )) |
| 22 | } | 25 | } |
| 23 | 26 | ||
| 24 | pub fn steps() -> Unit { | 27 | pub fn steps() -> Option<Unit> { |
| 25 | unit::dynamic(unit::Range::new("steps")) | 28 | Some(unit::dynamic(unit::Range::new("steps"))) |
| 26 | } | 29 | } |
| 27 | 30 | ||
| 28 | /// A structure passing every 'read' call through to the contained Progress instance using `inc_by(bytes_read)`. | 31 | /// A structure passing every 'read' call through to the contained Progress instance using `inc_by(bytes_read)`. |