Skip to content

Commit

Permalink
Rollup merge of rust-lang#125746 - jmillikin:duration-from-weeks-typo…
Browse files Browse the repository at this point in the history
…, r=lqd

Fix copy-paste error in `Duration::from_weeks` panic message.
  • Loading branch information
matthiaskrgr authored May 30, 2024
2 parents cffcf9c + a8234d5 commit a4d00ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl Duration {
#[inline]
pub const fn from_weeks(weeks: u64) -> Duration {
if weeks > u64::MAX / (SECS_PER_MINUTE * MINS_PER_HOUR * HOURS_PER_DAY * DAYS_PER_WEEK) {
panic!("overflow in Duration::from_days");
panic!("overflow in Duration::from_weeks");
}

Duration::from_secs(weeks * MINS_PER_HOUR * SECS_PER_MINUTE * HOURS_PER_DAY * DAYS_PER_WEEK)
Expand Down

0 comments on commit a4d00ff

Please sign in to comment.