From 83f2238c65e7b3b039c1600af0afc39b935ef50d Mon Sep 17 00:00:00 2001 From: miampf Date: Tue, 4 Jun 2024 23:26:13 +0200 Subject: [PATCH] actually implement `with_fill_finished` --- src/glitzer.gleam | 4 +++- src/glitzer/progress.gleam | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glitzer.gleam b/src/glitzer.gleam index 292fd37..7ae3682 100644 --- a/src/glitzer.gleam +++ b/src/glitzer.gleam @@ -5,7 +5,9 @@ import glitzer/progress pub fn sleep(ms: Int) -> a pub fn main() { - let bar = progress.default_bar() + let bar = + progress.default_bar() + |> progress.with_fill_finished(progress.char_from_string("-")) do_something(bar, 0) } diff --git a/src/glitzer/progress.gleam b/src/glitzer/progress.gleam index 8beda66..56f5eb6 100644 --- a/src/glitzer/progress.gleam +++ b/src/glitzer/progress.gleam @@ -127,7 +127,7 @@ pub fn with_fill_finished( bar bar: ProgressStyle, fill char: Char, ) -> ProgressStyle { - todo + ProgressStyle(..bar, fill_finished: option.Some(char)) } /// Add length to a progress bar.