Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ciehanski
Copy link

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
Copy link
Owner

fosskers commented Mar 6, 2023

Thank you! I will take a look.

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@fosskers
Copy link
Owner

fosskers commented May 9, 2023

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
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