linya
linya copied to clipboard
[feat] allow users to set label and total after Bar's initialization
Hello!
Firstly, thank you for a fantastic crate. I appreciate how simple and easy Linya
is compared to many other progress bar crates out there.
This PR would add 4 pub set helper functions which would allow the user to modify a specific Bar
's total or label after the Bar
has been initialized. I've found this useful in cases where I do not know the total size of the data, but I want the draw the progress bar and then update its total once gathered. In my local tests I was able to accomplish what I was after.
If there is a more optimal way to achieve this without the need for this PR, please let me know.
Thanks, ciehanski
Thank you! I will take a look.
Sorry that the review took so long! Overall it looks good. I think we can improve the naming a bit; the word "total" is a bit confusing (my own fault for the original wording). It's not clear whether it refers to the running total, or the "target total", so I suggested a switch to "target". Thoughts?
Makes sense to me, I completely agree - target
is more clear here than total
. I've committed the changes!