Skip to content

[feat] allow users to set label and total after Bar's initialization#11

Open
ciehanski wants to merge 2 commits into
fosskers:masterfrom
ciehanski:label_total
Open

[feat] allow users to set label and total after Bar's initialization#11
ciehanski wants to merge 2 commits into
fosskers:masterfrom
ciehanski:label_total

Conversation

@ciehanski

Copy link
Copy Markdown

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

@fosskers

fosskers commented Mar 6, 2023

Copy link
Copy Markdown
Owner

Thank you! I will take a look.

Comment thread src/lib.rs Outdated
Comment thread src/lib.rs Outdated
Comment thread src/lib.rs Outdated
Comment thread src/lib.rs Outdated
@fosskers

fosskers commented May 9, 2023

Copy link
Copy Markdown
Owner

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?

@ciehanski

Copy link
Copy Markdown
Author

Makes sense to me, I completely agree - target is more clear here than total. I've committed the changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants