File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,6 @@ pub fn sleep_until(deadline: Instant) -> Sleep {
76
76
///
77
77
/// To run something regularly on a schedule, see [`interval`].
78
78
///
79
- /// The maximum duration for a sleep is 68719476734 milliseconds (approximately 2.2 years).
80
- ///
81
79
/// # Cancellation
82
80
///
83
81
/// Canceling a sleep instance is done by dropping the returned future. No additional
Original file line number Diff line number Diff line change @@ -259,13 +259,10 @@ async fn reset_after_firing() {
259
259
. poll( & mut Context :: from_waker( noop_waker_ref( ) ) ) ) ;
260
260
}
261
261
262
- const NUM_LEVELS : usize = 6 ;
263
- const MAX_DURATION : u64 = ( 1 << ( 6 * NUM_LEVELS ) ) - 1 ;
264
-
265
262
#[ tokio:: test]
266
263
async fn exactly_max ( ) {
267
264
time:: pause ( ) ;
268
- time:: sleep ( ms ( MAX_DURATION ) ) . await ;
265
+ time:: sleep ( Duration :: MAX ) . await ;
269
266
}
270
267
271
268
#[ tokio:: test]
@@ -285,7 +282,7 @@ async fn issue_5183() {
285
282
#[ tokio:: test]
286
283
async fn no_out_of_bounds_close_to_max ( ) {
287
284
time:: pause ( ) ;
288
- time:: sleep ( ms ( MAX_DURATION - 1 ) ) . await ;
285
+ time:: sleep ( Duration :: MAX - Duration :: from_millis ( 1 ) ) . await ;
289
286
}
290
287
291
288
fn ms ( n : u64 ) -> Duration {
You can’t perform that action at this time.
0 commit comments