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

Hard deprecate Timestamp::to_unix_nanos #673

Merged
merged 2 commits into from
May 15, 2023
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
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ jobs:
strategy:
matrix:
exclude:
- os: macos-10.15
- os: macos-latest
rust_target: x86_64-gnu
- os: macos-10.15
- os: macos-latest
rust_target: x86_64-msvc
- os: windows-2019
- os: windows-latest
rust_target: x86_64-apple-darwin
- os: ubuntu-20.04
- os: ubuntu-latest
rust_target: x86_64-msvc
- os: ubuntu-20.04
- os: ubuntu-latest
rust_target: x86_64-apple-darwin
channel:
- stable
- beta
- nightly
os:
- macos-10.15
- ubuntu-20.04
- windows-2019
- macos-latest
- ubuntu-latest
- windows-latest
rust_target:
- x86_64-gnu
- x86_64-msvc
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:

stable:
name: "Tests / Stable"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
Expand All @@ -79,7 +79,7 @@ jobs:

msrv:
name: "Tests / MSRV"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
Expand Down
10 changes: 2 additions & 8 deletions src/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,14 @@ impl Timestamp {
)
}

#[deprecated(note = "use `to_unix` instead")]
#[deprecated(note = "use `to_unix` instead; this method will be removed in a future release")]
/// Get the number of fractional nanoseconds in the Unix timestamp.
///
/// This method is deprecated and probably doesn't do what you're expecting it to.
/// It doesn't return the timestamp as nanoseconds since the Unix epoch, it returns
/// the fractional seconds of the timestamp.
pub const fn to_unix_nanos(&self) -> u32 {
// NOTE: This method never did what it said on the tin: instead of
// converting the timestamp into nanos it simply returned the nanoseconds
// part of the timestamp.
//
// We can't fix the behavior because the return type is too small to fit
// a useful value for nanoseconds since the epoch.
self.nanos
panic!("`Timestamp::to_unix_nanos` is deprecated and will be removed: use `Timestamp::to_unix` instead")
}
}

Expand Down