Skip to content

Commit b6321bd

Browse files
author
Eugene Bulkin
committed
Add feature crate attribute for duration_checked_ops to docs
1 parent f2eb4f1 commit b6321bd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libstd/time/duration.rs

+8
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ impl Duration {
106106
/// Basic usage:
107107
///
108108
/// ```
109+
/// #![feature(duration_checked_ops)]
110+
///
109111
/// use std::time::Duration;
110112
///
111113
/// assert_eq!(Duration::new(0, 0).checked_add(Duration::new(0, 1)), Some(Duration::new(0, 1)));
@@ -142,6 +144,8 @@ impl Duration {
142144
/// Basic usage:
143145
///
144146
/// ```
147+
/// #![feature(duration_checked_ops)]
148+
///
145149
/// use std::time::Duration;
146150
///
147151
/// assert_eq!(Duration::new(0, 1).checked_sub(Duration::new(0, 0)), Some(Duration::new(0, 1)));
@@ -176,6 +180,8 @@ impl Duration {
176180
/// Basic usage:
177181
///
178182
/// ```
183+
/// #![feature(duration_checked_ops)]
184+
///
179185
/// use std::time::Duration;
180186
///
181187
/// assert_eq!(Duration::new(0, 500_000_001).checked_mul(2), Some(Duration::new(1, 2)));
@@ -209,6 +215,8 @@ impl Duration {
209215
/// Basic usage:
210216
///
211217
/// ```
218+
/// #![feature(duration_checked_ops)]
219+
///
212220
/// use std::time::Duration;
213221
///
214222
/// assert_eq!(Duration::new(2, 0).checked_div(2), Some(Duration::new(1, 0)));

0 commit comments

Comments
 (0)