@@ -123,19 +123,6 @@ impl Duration {
123
123
#[ unstable( feature = "duration_zero" , issue = "73544" ) ]
124
124
pub const ZERO : Duration = Duration :: from_nanos ( 0 ) ;
125
125
126
- /// The minimum duration.
127
- ///
128
- /// # Examples
129
- ///
130
- /// ```
131
- /// #![feature(duration_constants)]
132
- /// use std::time::Duration;
133
- ///
134
- /// assert_eq!(Duration::MIN, Duration::new(0, 0));
135
- /// ```
136
- #[ unstable( feature = "duration_constants" , issue = "57391" ) ]
137
- pub const MIN : Duration = Duration :: from_nanos ( 0 ) ;
138
-
139
126
/// The maximum duration.
140
127
///
141
128
/// It is roughly equal to a duration of 584,942,417,355 years.
@@ -533,26 +520,26 @@ impl Duration {
533
520
}
534
521
}
535
522
536
- /// Saturating `Duration` subtraction. Computes `self - other`, returning [`Duration::MIN `]
523
+ /// Saturating `Duration` subtraction. Computes `self - other`, returning [`Duration::ZERO `]
537
524
/// if the result would be negative or if overflow occurred.
538
525
///
539
526
/// # Examples
540
527
///
541
528
/// ```
542
529
/// #![feature(duration_saturating_ops)]
543
- /// #![feature(duration_constants )]
530
+ /// #![feature(duration_zero )]
544
531
/// use std::time::Duration;
545
532
///
546
533
/// assert_eq!(Duration::new(0, 1).saturating_sub(Duration::new(0, 0)), Duration::new(0, 1));
547
- /// assert_eq!(Duration::new(0, 0).saturating_sub(Duration::new(0, 1)), Duration::MIN );
534
+ /// assert_eq!(Duration::new(0, 0).saturating_sub(Duration::new(0, 1)), Duration::ZERO );
548
535
/// ```
549
536
#[ unstable( feature = "duration_saturating_ops" , issue = "76416" ) ]
550
537
#[ inline]
551
538
#[ rustc_const_unstable( feature = "duration_consts_2" , issue = "72440" ) ]
552
539
pub const fn saturating_sub ( self , rhs : Duration ) -> Duration {
553
540
match self . checked_sub ( rhs) {
554
541
Some ( res) => res,
555
- None => Duration :: MIN ,
542
+ None => Duration :: ZERO ,
556
543
}
557
544
}
558
545
0 commit comments