-
Notifications
You must be signed in to change notification settings - Fork 94
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
[r2r] Use futures_timer
crate and fix unstable tests
#1511
Conversation
* Remove `TimedMutexGuard` as it's not used anymore
futures_timer
cratefutures_timer
crate and fix unstable tests
Initially, I thought that the Also I figured out that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always nice to remove some old over-complicated code 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice and great work.
Just a question
pub fn sleep_ms(ms: u32) -> Timer { | ||
let seconds = gstuff::duration_to_float(Duration::from_millis(ms as u64)); | ||
Timer { | ||
till_utc: now_float() + seconds, | ||
delay: Delay::new(Duration::from_millis(ms as u64)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is sleep_ms
param not u64 by default instead of requesting for u32
and then casting to u64
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question! I don't know actually, but I think it's worth to change to u64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok good thanks 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! LGTM
TimedMutexGuard
as it's not used anymore