Add feature crate attribute for duration_checked_ops to docs
This commit is contained in:
parent
f2eb4f11d0
commit
b6321bd133
1 changed files with 8 additions and 0 deletions
|
|
@ -106,6 +106,8 @@ impl Duration {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(duration_checked_ops)]
|
||||
///
|
||||
/// use std::time::Duration;
|
||||
///
|
||||
/// assert_eq!(Duration::new(0, 0).checked_add(Duration::new(0, 1)), Some(Duration::new(0, 1)));
|
||||
|
|
@ -142,6 +144,8 @@ impl Duration {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(duration_checked_ops)]
|
||||
///
|
||||
/// use std::time::Duration;
|
||||
///
|
||||
/// assert_eq!(Duration::new(0, 1).checked_sub(Duration::new(0, 0)), Some(Duration::new(0, 1)));
|
||||
|
|
@ -176,6 +180,8 @@ impl Duration {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(duration_checked_ops)]
|
||||
///
|
||||
/// use std::time::Duration;
|
||||
///
|
||||
/// assert_eq!(Duration::new(0, 500_000_001).checked_mul(2), Some(Duration::new(1, 2)));
|
||||
|
|
@ -209,6 +215,8 @@ impl Duration {
|
|||
/// Basic usage:
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(duration_checked_ops)]
|
||||
///
|
||||
/// use std::time::Duration;
|
||||
///
|
||||
/// assert_eq!(Duration::new(2, 0).checked_div(2), Some(Duration::new(1, 0)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue