Skip to content

Commit

Permalink
Remove deprecated formatting functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Jan 28, 2024
1 parent b2b53c4 commit 2e6f76c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 50 deletions.
47 changes: 0 additions & 47 deletions src/format/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,53 +139,6 @@ impl<'a, I: Iterator<Item = B> + Clone, B: Borrow<Item<'a>>> Display for Delayed
}
}

/// Tries to format given arguments with given formatting items.
/// Internally used by `DelayedFormat`.
#[cfg(feature = "alloc")]
#[deprecated(since = "0.4.32", note = "Use DelayedFormat::fmt instead")]
pub fn format<'a, I, B>(
w: &mut fmt::Formatter,
date: Option<&NaiveDate>,
time: Option<&NaiveTime>,
off: Option<&(String, FixedOffset)>,
items: I,
) -> fmt::Result
where
I: Iterator<Item = B> + Clone,
B: Borrow<Item<'a>>,
{
DelayedFormat {
date: date.copied(),
time: time.copied(),
off: off.cloned(),
items,
#[cfg(feature = "unstable-locales")]
locale: None,
}
.fmt(w)
}

/// Formats single formatting item
#[cfg(feature = "alloc")]
#[deprecated(since = "0.4.32", note = "Use DelayedFormat::fmt instead")]
pub fn format_item(
w: &mut fmt::Formatter,
date: Option<&NaiveDate>,
time: Option<&NaiveTime>,
off: Option<&(String, FixedOffset)>,
item: &Item<'_>,
) -> fmt::Result {
DelayedFormat {
date: date.copied(),
time: time.copied(),
off: off.cloned(),
items: [item].into_iter(),
#[cfg(feature = "unstable-locales")]
locale: None,
}
.fmt(w)
}

#[cfg(feature = "alloc")]
fn format_inner(
w: &mut impl Write,
Expand Down
5 changes: 2 additions & 3 deletions src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ pub(crate) use formatting::write_hundreds;
pub(crate) use formatting::write_rfc2822;
#[cfg(any(feature = "alloc", feature = "serde", feature = "rustc-serialize"))]
pub(crate) use formatting::write_rfc3339;
pub use formatting::SecondsFormat;
#[cfg(feature = "alloc")]
#[allow(deprecated)]
pub use formatting::{format, format_item, DelayedFormat};
pub use formatting::DelayedFormat;
pub use formatting::SecondsFormat;
#[cfg(feature = "unstable-locales")]
pub use locales::Locale;
pub(crate) use parse::parse_rfc3339;
Expand Down

0 comments on commit 2e6f76c

Please sign in to comment.