Skip to content

Commit

Permalink
introducing to_time_scale
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume W. Bres <[email protected]>
  • Loading branch information
gwbres committed May 28, 2023
1 parent 0062d93 commit b6580ea
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 163 deletions.
36 changes: 20 additions & 16 deletions src/deprecated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@ impl Epoch {
self.to_duration_since_j1900()
}

#[must_use]
#[deprecated(
note = "Prefix for this function is now `to_` instead of `as_`.",
since = "3.5.0"
)]
pub fn as_duration_since_j1900_in_time_scale(&self, time_scale: TimeScale) -> Duration {
self.to_duration_since_j1900_in_time_scale(time_scale)
}
/*
#[must_use]
#[deprecated(
note = "Prefix for this function is now `to_` instead of `as_`.",
since = "3.5.0"
)]
pub fn as_duration_since_j1900_in_time_scale(&self, time_scale: TimeScale) -> Duration {
self.to_duration_since_j1900_in_time_scale(time_scale)
}
*/

#[must_use]
#[deprecated(
Expand All @@ -96,14 +98,16 @@ impl Epoch {
self.to_tai_seconds()
}

#[must_use]
#[deprecated(
note = "Prefix for this function is now `to_` instead of `as_`.",
since = "3.5.0"
)]
pub const fn as_tai_duration(&self) -> Duration {
self.to_tai_duration()
}
/*
#[must_use]
#[deprecated(
note = "Prefix for this function is now `to_` instead of `as_`.",
since = "3.5.0"
)]
pub const fn as_tai_duration(&self) -> Duration {
self.to_tai_duration()
}
*/

#[must_use]
#[deprecated(
Expand Down
4 changes: 2 additions & 2 deletions src/efmt/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ impl Formatter {
}
}

pub fn in_time_scale(epoch: Epoch, format: Format, time_scale: TimeScale) -> Self {
Self::new(epoch.in_time_scale(time_scale), format)
pub fn to_time_scale(epoch: Epoch, format: Format, time_scale: TimeScale) -> Self {
Self::new(epoch.to_time_scale(time_scale), format)
}

pub fn set_timezone(&mut self, offset: Duration) {
Expand Down
Loading

0 comments on commit b6580ea

Please sign in to comment.