Skip to content

Commit d89c69d

Browse files
committed
hard deprecate Timestamp::to_unix_nanos
1 parent 6d22d0c commit d89c69d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/timestamp.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,14 @@ impl Timestamp {
137137
)
138138
}
139139

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

0 commit comments

Comments
 (0)