Skip to content

Commit

Permalink
MOD: Update for BorrowedFormatItem rename
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen committed Apr 10, 2024
1 parent 722723b commit 16cc4cd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/dbn/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ strum = { version = "0.26", features = ["derive"], optional = true }
# Custom error helper
thiserror = "1.0"
# date and datetime support
time = { version = "0.3", features = ["formatting", "macros"] }
time = { version = ">=0.3.35", features = ["formatting", "macros"] }
# async traits
tokio = { version = "1", features = ["fs", "io-util"], optional = true }
# (de)compression
Expand Down
2 changes: 1 addition & 1 deletion rust/dbn/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ pub struct MappingInterval {
}

/// The date format used for date strings when serializing [`Metadata`].
pub const DATE_FORMAT: &[time::format_description::FormatItem<'static>] =
pub const DATE_FORMAT: &[time::format_description::BorrowedFormatItem<'static>] =
time::macros::format_description!("[year]-[month]-[day]");

#[cfg(feature = "serde")]
Expand Down
4 changes: 2 additions & 2 deletions rust/dbn/src/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::fmt;

use time::format_description::FormatItem;
use time::format_description::BorrowedFormatItem;

use crate::FIXED_PRICE_SCALE;

Expand Down Expand Up @@ -68,7 +68,7 @@ pub fn fmt_px(px: i64) -> String {
/// Converts a nanosecond UNIX timestamp to a human-readable string in the format
/// `[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond digits:9]Z`.
pub fn fmt_ts(ts: u64) -> String {
const TS_FORMAT: &[FormatItem<'static>] = time::macros::format_description!(
const TS_FORMAT: &[BorrowedFormatItem<'static>] = time::macros::format_description!(
"[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond digits:9]Z"
);
if ts == 0 {
Expand Down

0 comments on commit 16cc4cd

Please sign in to comment.