summaryrefslogtreecommitdiff
path: root/src/progress_bar.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-05-14 01:49:22 +0200
committermo8it <mo8it@proton.me>2024-05-14 01:49:22 +0200
commitc8481d35c120ff99213e6ed73ba889e51cac10c5 (patch)
treefa6e94b279a0f0ff85b87fea33b5a0566f83179c /src/progress_bar.rs
parent96a44f3dcf2dd9e2562b757d7840084b45b90b61 (diff)
Done documentation
Diffstat (limited to 'src/progress_bar.rs')
-rw-r--r--src/progress_bar.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/progress_bar.rs b/src/progress_bar.rs
index d6962b8..4a54170 100644
--- a/src/progress_bar.rs
+++ b/src/progress_bar.rs
@@ -12,6 +12,7 @@ const MIN_LINE_WIDTH: u16 = WRAPPER_WIDTH + 4;
const PROGRESS_EXCEEDS_MAX_ERR: &str =
"The progress of the progress bar is higher than the maximum";
+/// Terminal progress bar to be used when not using Ratataui.
pub fn progress_bar(progress: u16, total: u16, line_width: u16) -> Result<String> {
use crossterm::style::Stylize;
@@ -54,6 +55,8 @@ pub fn progress_bar(progress: u16, total: u16, line_width: u16) -> Result<String
Ok(line)
}
+/// Progress bar to be used with Ratataui.
+// Not using Ratatui's Gauge widget to keep the progress bar consistent.
pub fn progress_bar_ratatui(progress: u16, total: u16, line_width: u16) -> Result<Line<'static>> {
use ratatui::style::Stylize;