Skip to content

Commit

Permalink
reverse direction of unbounded progress by reversing an iterator, nice!
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jul 10, 2020
1 parent 89fb23c commit 380330d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/line/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,12 @@ fn draw_progress_bar<'a>(
'⠁', '⠁', '⠉', '⠙', '⠚', '⠒', '⠂', '⠂', '⠒', '⠲', '⠴', '⠤', '⠄', '⠄', '⠤', '⠠', '⠠', '⠤', '⠦', '⠖',
'⠒', '⠐', '⠐', '⠒', '⠓', '⠋', '⠉', '⠈', '⠈',
];
let bar: String = (0usize..)
let bar: String = (0usize..std::usize::MAX)
.into_iter()
.skip(ticks)
.take(blocks_available as usize)
.map(|idx| chars[idx % chars.len()])
.rev()
.collect();
buf.push(style.paint(bar));
}
Expand Down

0 comments on commit 380330d

Please sign in to comment.