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