Skip to content

Commit

Permalink
ref: Rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-auer committed May 4, 2022
1 parent a104202 commit 9679448
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions relay-common/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn duration_to_millis(duration: Duration) -> f64 {
/// use chrono::Duration;
///
/// let duration = Duration::nanoseconds(2_125_000);
/// let millis = relay_common::signed_duration_to_millis(duration);
/// let millis = relay_common::chrono_to_positive_millis(duration);
/// assert_eq!(millis, 2.125);
/// ```
///
Expand All @@ -54,10 +54,10 @@ pub fn duration_to_millis(duration: Duration) -> f64 {
/// use chrono::Duration;
///
/// let duration = Duration::nanoseconds(-2_125_000);
/// let millis = relay_common::signed_duration_to_millis(duration);
/// let millis = relay_common::chrono_to_positive_millis(duration);
/// assert_eq!(millis, 0.0);
/// ```
pub fn signed_duration_to_millis(duration: chrono::Duration) -> f64 {
pub fn chrono_to_positive_millis(duration: chrono::Duration) -> f64 {
duration_to_millis(duration.to_std().unwrap_or_default())
}

Expand Down

0 comments on commit 9679448

Please sign in to comment.