@@ -13,14 +13,12 @@ use core::fmt;
13
13
use fixed_decimal:: FixedDecimal ;
14
14
use icu_decimal:: FixedDecimalFormatter ;
15
15
use icu_timezone:: UtcOffset ;
16
- use icu_timezone:: { TimeZoneBcp47Id , ZoneVariant } ;
17
- use tinystr:: tinystr;
16
+ use icu_timezone:: ZoneVariant ;
18
17
use writeable:: Writeable ;
19
18
20
19
/// All time zone styles that this crate can format
21
20
#[ derive( Debug , Copy , Clone ) ]
22
21
pub ( crate ) enum ResolvedNeoTimeZoneSkeleton {
23
- City ,
24
22
Location ,
25
23
GenericShort ,
26
24
GenericLong ,
@@ -44,7 +42,7 @@ pub(crate) enum ResolvedNeoTimeZoneSkeleton {
44
42
IsoXXXXX ,
45
43
// TODO:
46
44
// `VV` "America/Los_Angeles"
47
- // Generic Partial Location: "Pacific Time ( Los Angeles) "
45
+ // `VVV` " Los Angeles"
48
46
}
49
47
50
48
impl ResolvedNeoTimeZoneSkeleton {
@@ -166,7 +164,6 @@ pub(super) enum TimeZoneFormatterUnit {
166
164
LocalizedOffsetLong ,
167
165
LocalizedOffsetShort ,
168
166
Iso8601 ( Iso8601Format ) ,
169
- ExemplarCity ,
170
167
Bcp47Id ,
171
168
}
172
169
@@ -257,7 +254,6 @@ impl FormatTimeZone for TimeZoneFormatterUnit {
257
254
ShortLocalizedOffsetFormat . format ( sink, input, data_payloads, fdf)
258
255
}
259
256
Self :: Iso8601 ( iso) => iso. format ( sink, input, data_payloads, fdf) ,
260
- Self :: ExemplarCity => ExemplarCityFormat . format ( sink, input, data_payloads, fdf) ,
261
257
Self :: Bcp47Id => Bcp47IdFormat . format ( sink, input, data_payloads, fdf) ,
262
258
}
263
259
}
@@ -851,44 +847,6 @@ impl Iso8601Format {
851
847
}
852
848
}
853
849
854
- // Writes the exemplar city associated with this time zone.
855
- // It is only used for pattern in special case and not public to users.
856
- struct ExemplarCityFormat ;
857
-
858
- impl FormatTimeZone for ExemplarCityFormat {
859
- fn format < W : writeable:: PartsWrite + ?Sized > (
860
- & self ,
861
- sink : & mut W ,
862
- input : & ExtractedInput ,
863
- data_payloads : TimeZoneDataPayloadsBorrowed ,
864
- _fdf : Option < & FixedDecimalFormatter > ,
865
- ) -> Result < Result < ( ) , FormatTimeZoneError > , fmt:: Error > {
866
- let Some ( time_zone_id) = input. time_zone_id else {
867
- return Ok ( Err ( FormatTimeZoneError :: MissingInputField ( "time_zone_id" ) ) ) ;
868
- } ;
869
- let Some ( exemplar_cities) = data_payloads. exemplar_cities else {
870
- return Ok ( Err ( FormatTimeZoneError :: MissingZoneSymbols ) ) ;
871
- } ;
872
-
873
- let city = exemplar_cities
874
- . 0
875
- . get ( & time_zone_id)
876
- // Writes the unknown city "Etc/Unknown" for the current locale.
877
- //
878
- // If there is no localized form of "Etc/Unknown" for the current locale,
879
- // returns the "Etc/Unknown" value of the `und` locale as a hard-coded string.
880
- //
881
- // This can be used as a fallback if [`exemplar_city()`](TimeZoneFormatter::exemplar_city())
882
- // is unable to produce a localized form of the time zone's exemplar city in the current locale.
883
- . or_else ( || exemplar_cities. 0 . get ( & TimeZoneBcp47Id ( tinystr ! ( 8 , "unk" ) ) ) )
884
- . unwrap_or ( "Unknown" ) ;
885
-
886
- sink. write_str ( city) ?;
887
-
888
- Ok ( Ok ( ( ) ) )
889
- }
890
- }
891
-
892
850
// It is only used for pattern in special case and not public to users.
893
851
struct Bcp47IdFormat ;
894
852
0 commit comments