Skip to content

Commit

Permalink
Add feature crate attribute for duration_checked_ops to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Bulkin committed Sep 15, 2016
1 parent f2eb4f1 commit b6321bd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libstd/time/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down Expand Up @@ -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)));
Expand Down Expand Up @@ -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)));
Expand Down Expand Up @@ -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)));
Expand Down

0 comments on commit b6321bd

Please sign in to comment.