From ffbed1bdb1f912488b7b5141f6c5d9ff60252460 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Sat, 1 Jul 2023 14:30:46 +0200 Subject: [PATCH] Deprecate standalone `format*` functions --- src/format/formatting.rs | 4 ++++ src/format/mod.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/format/formatting.rs b/src/format/formatting.rs index 2e726519c0..e8f67ee2a5 100644 --- a/src/format/formatting.rs +++ b/src/format/formatting.rs @@ -161,6 +161,7 @@ impl<'a, I: Iterator + Clone, B: Borrow>> Display for Delayed /// Internally used by `DelayedFormat`. #[cfg(any(feature = "alloc", feature = "std"))] #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] +#[deprecated(since = "0.4.32")] pub fn format<'a, I, B>( w: &mut fmt::Formatter, date: Option<&NaiveDate>, @@ -186,6 +187,7 @@ where /// Formats single formatting item #[cfg(any(feature = "alloc", feature = "std"))] #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] +#[deprecated(since = "0.4.32")] pub fn format_item( w: &mut fmt::Formatter, date: Option<&NaiveDate>, @@ -208,6 +210,7 @@ pub fn format_item( /// Internally used by `DelayedFormat`. #[cfg(feature = "unstable-locales")] #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] +#[deprecated(since = "0.4.32")] pub fn format_localized<'a, I, B>( w: &mut fmt::Formatter, date: Option<&NaiveDate>, @@ -233,6 +236,7 @@ where /// Formats single formatting item #[cfg(feature = "unstable-locales")] #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] +#[deprecated(since = "0.4.32")] pub fn format_item_localized( w: &mut fmt::Formatter, date: Option<&NaiveDate>, diff --git a/src/format/mod.rs b/src/format/mod.rs index d22cdf071a..d86affab90 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -62,8 +62,10 @@ pub(crate) use formatting::write_rfc2822; ))] pub(crate) use formatting::write_rfc3339; #[cfg(any(feature = "alloc", feature = "std"))] +#[allow(deprecated)] pub use formatting::{format, format_item, DelayedFormat}; #[cfg(feature = "unstable-locales")] +#[allow(deprecated)] pub use formatting::{format_item_localized, format_localized}; #[cfg(all(feature = "unstable-locales", any(feature = "alloc", feature = "std")))] pub use locales::Locale;