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

Implemented tqdm_total to Enable Crate User Setting a Pbar Length #21

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

Conversation

RealJoL
Copy link

@RealJoL RealJoL commented Oct 23, 2024

Closes #20.

Unfortunately, Rust does not allow for overloading of functions via varying parameter lengths. I've added a function tqdm_total that sets a user-given pbar length. As this opens to the door to Info.total being smaller than the number of iterations, I've adjusted the crate behavior to be similar to the python tqdm crate. Should the number of iterations be higher than foreseen by the user, the progress bar disappears.

I also ran cargo fmt across the project and changed impl ToString into impl Display to keep in line with best practices.

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.

total parameter in tqdm
1 participant