-
Notifications
You must be signed in to change notification settings - Fork 891
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
Download progress take 3 #73
Download progress take 3 #73
Conversation
Uh-Oh! It looks like rustfmt actually messed up some code, making it no longer compile. |
One way to avoid For the former, I imagine something like For the latter, I'm not sure how expensive it is constructing a new |
This is what the current implementation looks like in action: https://asciinema.org/a/3oayn89jweqvbj6t7oi8f0zzr |
Looks good to me. The Rc is fine - this doesn't need to be hyper-optimized. multirust-rs should probably not do this when it is not outputting to a tty - it will print lines and lines of updates. There's some tty detection code in my patch so maybe it can be fixed up later. |
@crumblingstatue Great work, thanks! WRT However, as @brson rightly points out, it really doesn't matter in this case! Any minor improvements can be made later, so I'll merge this in now. |
This implements the progress indication part of #71.
Since I don't know how to measure download speed without adding
another dependency (
time
), this only implements download progress display,but not speed (which is less important).
Library
The library part just adds the various notifications for the download events.
Notification
implementsDisplay
, but download events aren't supposed to beprinted out normally, so the
Display
implementations for them aren't utilized right now.Client
To avoid having to implement architectural changes, I have once again opted for using
Rc
and friends. It shouldn't be a performance problem, but maybe someone has a better idea.Other
I also ran rustfmt in a follow-up commit to clean up after myself, which also affected some unrelated code.
Maybe the frequency of printing out the download events could be lessened (maybe once per second), but again, this would probably require something like the
time
crate.