Skip to content

Commit

Permalink
Fix an off-by-one error when calculating current nightly date in local
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Oct 23, 2020
1 parent 9cc74c4 commit a18023a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/toolchains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ impl Toolchain {
let month = cap.get(2)?.as_str().parse::<u32>().ok()?;
let day = cap.get(3)?.as_str().parse::<u32>().ok()?;

return Some(Date::from_utc(
naive::NaiveDate::from_ymd(year, month, day),
Utc,
));
// rustc commit date is off-by-one.
let date = naive::NaiveDate::from_ymd(year, month, day).succ();

return Some(Date::from_utc(date, Utc));
}
}
}
Expand Down

0 comments on commit a18023a

Please sign in to comment.