@@ -65,7 +65,7 @@ pub const MAX: Duration = Duration {
65
65
impl Duration {
66
66
/// Makes a new `Duration` with given number of weeks.
67
67
/// Equivalent to `Duration::seconds(weeks * 7 * 24 * 60 * 60), with overflow checks.
68
- /// Fails when the duration is out of bounds.
68
+ /// Panics when the duration is out of bounds.
69
69
#[ inline]
70
70
pub fn weeks ( weeks : i64 ) -> Duration {
71
71
let secs = weeks. checked_mul ( SECS_PER_WEEK ) . expect ( "Duration::weeks out of bounds" ) ;
@@ -74,7 +74,7 @@ impl Duration {
74
74
75
75
/// Makes a new `Duration` with given number of days.
76
76
/// Equivalent to `Duration::seconds(days * 24 * 60 * 60)` with overflow checks.
77
- /// Fails when the duration is out of bounds.
77
+ /// Panics when the duration is out of bounds.
78
78
#[ inline]
79
79
pub fn days ( days : i64 ) -> Duration {
80
80
let secs = days. checked_mul ( SECS_PER_DAY ) . expect ( "Duration::days out of bounds" ) ;
@@ -83,7 +83,7 @@ impl Duration {
83
83
84
84
/// Makes a new `Duration` with given number of hours.
85
85
/// Equivalent to `Duration::seconds(hours * 60 * 60)` with overflow checks.
86
- /// Fails when the duration is out of bounds.
86
+ /// Panics when the duration is out of bounds.
87
87
#[ inline]
88
88
pub fn hours ( hours : i64 ) -> Duration {
89
89
let secs = hours. checked_mul ( SECS_PER_HOUR ) . expect ( "Duration::hours ouf of bounds" ) ;
@@ -92,15 +92,15 @@ impl Duration {
92
92
93
93
/// Makes a new `Duration` with given number of minutes.
94
94
/// Equivalent to `Duration::seconds(minutes * 60)` with overflow checks.
95
- /// Fails when the duration is out of bounds.
95
+ /// Panics when the duration is out of bounds.
96
96
#[ inline]
97
97
pub fn minutes ( minutes : i64 ) -> Duration {
98
98
let secs = minutes. checked_mul ( SECS_PER_MINUTE ) . expect ( "Duration::minutes out of bounds" ) ;
99
99
Duration :: seconds ( secs)
100
100
}
101
101
102
102
/// Makes a new `Duration` with given number of seconds.
103
- /// Fails when the duration is more than `i64::MAX` milliseconds
103
+ /// Panics when the duration is more than `i64::MAX` milliseconds
104
104
/// or less than `i64::MIN` milliseconds.
105
105
#[ inline]
106
106
pub fn seconds ( seconds : i64 ) -> Duration {
0 commit comments