@@ -24,9 +24,6 @@ use crate::{
2424 DateTimeError , FormattedDateTime ,
2525} ;
2626
27- #[ cfg( feature = "experimental" ) ]
28- use crate :: options:: components;
29-
3027/// [`TimeFormatter`] is a structure of the [`icu_datetime`] component that provides time formatting only.
3128/// When constructed, it uses data from the [data provider], selected locale and provided preferences to
3229/// collect all data necessary to format any time into that locale.
@@ -591,7 +588,7 @@ where {
591588
592589 /// Constructor that supports experimental options using compiled data.
593590 ///
594- /// ✨ *Enabled with the `compiled_data` Cargo feature .*
591+ /// ✨ *Enabled with the `compiled_data` and `experimental` Cargo features .*
595592 ///
596593 /// [📚 Help choosing a constructor](icu_provider::constructors)
597594 ///
@@ -661,41 +658,7 @@ where {
661658 ) )
662659 }
663660
664- /// Constructor that supports experimental options.
665- ///
666- /// <div class="stab unstable">
667- /// 🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways,
668- /// including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature
669- /// of the icu meta-crate. Use with caution.
670- /// <a href="https://github.com/unicode-org/icu4x/issues/1317">#1317</a>
671- /// </div>
672- ///
673- /// # Examples
674- ///
675- /// ```
676- /// use icu::calendar::{DateTime, Gregorian};
677- /// use icu::datetime::{options::components, TypedDateTimeFormatter};
678- /// use icu::locid::locale;
679- /// use icu_provider::AsDeserializingBufferProvider;
680- /// use writeable::assert_writeable_eq;
681- ///
682- /// let mut options = components::Bag::default();
683- /// options.year = Some(components::Year::Numeric);
684- /// options.month = Some(components::Month::Long);
685- ///
686- /// let dtf = TypedDateTimeFormatter::<Gregorian>::try_new_experimental(
687- /// &locale!("en").into(),
688- /// options.into(),
689- /// )
690- /// .unwrap();
691- ///
692- /// let datetime =
693- /// DateTime::try_new_gregorian_datetime(2022, 8, 31, 1, 2, 3).unwrap();
694- ///
695- /// assert_writeable_eq!(dtf.format(&datetime), "August 2022");
696- /// ```
697- ///
698- /// [data provider]: icu_provider
661+ #[ doc = icu_provider:: gen_any_buffer_unstable_docs!( UNSTABLE , Self :: try_new_experimental) ]
699662 #[ cfg( feature = "experimental" ) ]
700663 #[ inline]
701664 pub fn try_new_experimental_unstable < D > (
@@ -781,7 +744,7 @@ where {
781744 self . format ( value) . write_to_string ( ) . into_owned ( )
782745 }
783746
784- /// Returns a [`components::Bag`] that represents the resolved components for the
747+ /// Returns a [`components::Bag`](crate::options::components::Bag) that represents the resolved components for the
785748 /// options that were provided to the [`TypedDateTimeFormatter`]. The developer may request
786749 /// a certain set of options for a [`TypedDateTimeFormatter`] but the locale and resolution
787750 /// algorithm may change certain details of what actually gets resolved.
@@ -811,7 +774,7 @@ where {
811774 /// assert_eq!(dtf.resolve_components(), expected_components_bag);
812775 /// ```
813776 #[ cfg( feature = "experimental" ) ]
814- pub fn resolve_components ( & self ) -> components:: Bag {
777+ pub fn resolve_components ( & self ) -> crate :: options :: components:: Bag {
815778 self . 0 . resolve_components ( )
816779 }
817780}
0 commit comments