From a766bbdfec165b7eca9dfcc5640763c69cbe2854 Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Mon, 2 Oct 2023 08:14:02 +0200 Subject: [PATCH] Clean up `icu_datetime/experimental` (#4096) --- components/datetime/src/any/datetime.rs | 17 ++- components/datetime/src/any/zoned_datetime.rs | 9 +- components/datetime/src/datetime.rs | 45 +------- components/datetime/src/error.rs | 11 +- components/datetime/src/options/components.rs | 9 +- components/datetime/src/options/mod.rs | 2 + .../datetime/src/options/preferences.rs | 2 + components/datetime/src/provider/date_time.rs | 1 - components/datetime/src/raw/datetime.rs | 8 +- components/datetime/src/skeleton/error.rs | 7 ++ components/datetime/src/zoned_datetime.rs | 100 +++++++++--------- 11 files changed, 93 insertions(+), 118 deletions(-) diff --git a/components/datetime/src/any/datetime.rs b/components/datetime/src/any/datetime.rs index 10c46e92342..290b014ee9f 100644 --- a/components/datetime/src/any/datetime.rs +++ b/components/datetime/src/any/datetime.rs @@ -2,8 +2,6 @@ // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). -#[cfg(feature = "experimental")] -use crate::options::components; use crate::provider::{calendar::*, date_time::PatternSelector}; use crate::{calendar, options::DateTimeFormatterOptions, raw, DateFormatter, TimeFormatter}; use crate::{input::DateTimeInput, DateTimeError, FormattedDateTime}; @@ -277,7 +275,7 @@ impl DateTimeFormatter { /// Constructor that supports experimental options with compiled data. /// - /// ✨ *Enabled with the `compiled_data` Cargo feature.* + /// ✨ *Enabled with the `compiled_data` and `experimental` Cargo features.* /// /// [📚 Help choosing a constructor](icu_provider::constructors) /// @@ -499,11 +497,20 @@ where { Ok(self.format(value)?.write_to_string().into_owned()) } - /// Returns a [`components::Bag`] that represents the resolved components for the + /// Returns a [`components::Bag`](crate::options::components::Bag) that represents the resolved components for the /// options that were provided to the [`DateTimeFormatter`]. The developer may request /// a certain set of options for a [`DateTimeFormatter`] but the locale and resolution /// algorithm may change certain details of what actually gets resolved. /// + /// ✨ *Enabled with the `experimental` Cargo feature.* + /// + ///
( + pub fn try_new_unstable
(
provider: &P,
locale: &DataLocale,
date_time_format_options: DateTimeFormatterOptions,
@@ -176,7 +171,6 @@ impl (
+ pub fn try_new_experimental_unstable (
provider: &P,
locale: &DataLocale,
date_time_format_options: DateTimeFormatterOptions,
@@ -300,6 +298,7 @@ impl