Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert TimeDelta deprecations #1543

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ cff-version: 1.2.0
message: Please cite this crate using these information.

# Version information.
date-released: 2024-03-06
version: 0.4.35
date-released: 2024-03-26
version: 0.4.36

# Project information.
abstract: Date and time library for Rust
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chrono"
version = "0.4.35"
version = "0.4.36"
description = "Date and time library for Rust"
homepage = "https://github.com/chronotope/chrono"
documentation = "https://docs.rs/chrono/"
Expand Down
9 changes: 0 additions & 9 deletions src/time_delta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ impl TimeDelta {
/// Panics when the duration is out of bounds.
#[inline]
#[must_use]
#[deprecated(since = "0.4.35", note = "Use `TimeDelta::try_weeks` instead")]
pub const fn weeks(weeks: i64) -> TimeDelta {
expect(TimeDelta::try_weeks(weeks), "TimeDelta::weeks out of bounds")
}
Expand Down Expand Up @@ -130,7 +129,6 @@ impl TimeDelta {
/// Panics when the `TimeDelta` would be out of bounds.
#[inline]
#[must_use]
#[deprecated(since = "0.4.35", note = "Use `TimeDelta::try_days` instead")]
pub const fn days(days: i64) -> TimeDelta {
expect(TimeDelta::try_days(days), "TimeDelta::days out of bounds")
}
Expand All @@ -157,7 +155,6 @@ impl TimeDelta {
/// Panics when the `TimeDelta` would be out of bounds.
#[inline]
#[must_use]
#[deprecated(since = "0.4.35", note = "Use `TimeDelta::try_hours` instead")]
pub const fn hours(hours: i64) -> TimeDelta {
expect(TimeDelta::try_hours(hours), "TimeDelta::hours out of bounds")
}
Expand All @@ -183,7 +180,6 @@ impl TimeDelta {
/// Panics when the `TimeDelta` would be out of bounds.
#[inline]
#[must_use]
#[deprecated(since = "0.4.35", note = "Use `TimeDelta::try_minutes` instead")]
pub const fn minutes(minutes: i64) -> TimeDelta {
expect(TimeDelta::try_minutes(minutes), "TimeDelta::minutes out of bounds")
}
Expand All @@ -208,7 +204,6 @@ impl TimeDelta {
/// (in this context, this is the same as `i64::MIN / 1_000` due to rounding).
#[inline]
#[must_use]
#[deprecated(since = "0.4.35", note = "Use `TimeDelta::try_seconds` instead")]
pub const fn seconds(seconds: i64) -> TimeDelta {
expect(TimeDelta::try_seconds(seconds), "TimeDelta::seconds out of bounds")
}
Expand All @@ -232,7 +227,6 @@ impl TimeDelta {
/// Panics when the `TimeDelta` would be out of bounds, i.e. when `milliseconds` is more than
/// `i64::MAX` or less than `-i64::MAX`. Notably, this is not the same as `i64::MIN`.
#[inline]
#[deprecated(since = "0.4.35", note = "Use `TimeDelta::try_milliseconds` instead")]
pub const fn milliseconds(milliseconds: i64) -> TimeDelta {
expect(TimeDelta::try_milliseconds(milliseconds), "TimeDelta::milliseconds out of bounds")
}
Expand Down Expand Up @@ -688,7 +682,6 @@ mod tests {
}

#[test]
#[allow(deprecated)]
#[should_panic(expected = "TimeDelta::seconds out of bounds")]
fn test_duration_seconds_max_overflow_panic() {
let _ = TimeDelta::seconds(i64::MAX / 1_000 + 1);
Expand All @@ -710,7 +703,6 @@ mod tests {
}

#[test]
#[allow(deprecated)]
#[should_panic(expected = "TimeDelta::seconds out of bounds")]
fn test_duration_seconds_min_underflow_panic() {
let _ = TimeDelta::seconds(-i64::MAX / 1_000 - 1);
Expand Down Expand Up @@ -773,7 +765,6 @@ mod tests {
}

#[test]
#[allow(deprecated)]
#[should_panic(expected = "TimeDelta::milliseconds out of bounds")]
fn test_duration_milliseconds_min_underflow_panic() {
// Here we ensure that trying to create a value one millisecond below the
Expand Down
Loading