-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Adding examples to docs of std::time
module
#88465
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon. Please see the contribution instructions for more information. |
std::time
module
@joshtriplett I found the |
I also thought about changing some in use std::time::Duration;
let five_seconds = Duration::new(5, 0);
let five_seconds_and_five_nanos = five_seconds + Duration::new(0, 5);
assert_eq!(five_seconds_and_five_nanos.as_secs(), 5);
assert_eq!(five_seconds_and_five_nanos.subsec_nanos(), 5);
let ten_millis = Duration::from_millis(10); The reason: I don't think I would prefer let five_seconds = Duration::from_secs(5); Instead of let five_seconds = Duration::new(5, 0); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
And adding missing link to Duration from Instant
@bors r+ rollup |
📌 Commit faf5985 has been approved by |
Rollup of 14 pull requests Successful merges: - rust-lang#88394 (Document `std::env::current_exe` possible rename behaviour) - rust-lang#88406 (Tait nest infer test) - rust-lang#88408 (Add inference cycle TAIT test) - rust-lang#88409 (Add auto trait leakage TAIT test) - rust-lang#88413 (Add weird return types TAIT test) - rust-lang#88450 (fix(rustc_parse): correct span in `maybe_whole_expr!`) - rust-lang#88462 (rustdoc: Stop using resolver for macro loading) - rust-lang#88465 (Adding examples to docs of `std::time` module) - rust-lang#88486 (Remove unused arena macro args) - rust-lang#88492 (Use MaybeUninit::write in functor.rs) - rust-lang#88496 (Fix prelude collision lint suggestion for generics with lifetimes) - rust-lang#88497 (Fix prelude collision suggestions for glob imported traits. ) - rust-lang#88503 (Warn when [T; N].into_iter() is ambiguous in the new edition. ) - rust-lang#88509 (Don't suggest extra <> in dyn suggestion.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
And adding missing link to
Duration
fromInstant
.