@@ -12,7 +12,7 @@ use crate::provider::{self, skeleton};
12
12
use icu_locale_core:: preferences:: extensions:: unicode:: keywords:: HourCycle ;
13
13
use icu_provider:: prelude:: * ;
14
14
15
- /// Used to represent either H11/H12, or H23/H24 . Skeletons only store these
15
+ /// Used to represent either H11/H12, or H23. Skeletons only store these
16
16
/// hour cycles as H12 or H23.
17
17
#[ derive( Debug , PartialEq , Clone , Copy , yoke:: Yokeable , zerofrom:: ZeroFrom ) ]
18
18
#[ cfg_attr( feature = "datagen" , derive( serde:: Serialize , databake:: Bake ) ) ]
@@ -22,15 +22,15 @@ use icu_provider::prelude::*;
22
22
pub enum CoarseHourCycle {
23
23
/// Can either be fields::Hour::H11 or fields::Hour::H12
24
24
H11H12 ,
25
- /// Can either be fields::Hour::H23 or fields::Hour::H24
26
- H23H24 ,
25
+ /// fields::Hour::H23
26
+ H23 ,
27
27
}
28
28
29
- /// Default is required for serialization. H23H24 is the more locale-agnostic choice, as it's
29
+ /// Default is required for serialization. H23 is the more locale-agnostic choice, as it's
30
30
/// less likely to have a day period in it.
31
31
impl Default for CoarseHourCycle {
32
32
fn default ( ) -> Self {
33
- CoarseHourCycle :: H23H24
33
+ CoarseHourCycle :: H23
34
34
}
35
35
}
36
36
@@ -46,7 +46,7 @@ impl CoarseHourCycle {
46
46
{
47
47
return Some ( match pattern_hour {
48
48
fields:: Hour :: H11 | fields:: Hour :: H12 => CoarseHourCycle :: H11H12 ,
49
- fields:: Hour :: H23 | fields :: Hour :: H24 => CoarseHourCycle :: H23H24 ,
49
+ fields:: Hour :: H23 => CoarseHourCycle :: H23 ,
50
50
} ) ;
51
51
}
52
52
}
@@ -71,11 +71,11 @@ impl CoarseHourCycle {
71
71
if match self {
72
72
CoarseHourCycle :: H11H12 => match pattern_hour {
73
73
fields:: Hour :: H11 | fields:: Hour :: H12 => true ,
74
- fields:: Hour :: H23 | fields :: Hour :: H24 => false ,
74
+ fields:: Hour :: H23 => false ,
75
75
} ,
76
- CoarseHourCycle :: H23H24 => match pattern_hour {
76
+ CoarseHourCycle :: H23 => match pattern_hour {
77
77
fields:: Hour :: H11 | fields:: Hour :: H12 => false ,
78
- fields:: Hour :: H23 | fields :: Hour :: H24 => true ,
78
+ fields:: Hour :: H23 => true ,
79
79
} ,
80
80
} {
81
81
// The preference hour cycle matches the pattern, bail out early and
@@ -85,7 +85,7 @@ impl CoarseHourCycle {
85
85
// Mutate the pattern with the new symbol, so that it can be matched against.
86
86
* symbol = fields:: FieldSymbol :: Hour ( match self {
87
87
CoarseHourCycle :: H11H12 => fields:: Hour :: H12 ,
88
- CoarseHourCycle :: H23H24 => fields:: Hour :: H23 ,
88
+ CoarseHourCycle :: H23 => fields:: Hour :: H23 ,
89
89
} ) ;
90
90
break ;
91
91
}
@@ -117,8 +117,8 @@ impl CoarseHourCycle {
117
117
/// Get the other coarse hour cycle (map h11/h12 to h23/h24, and vice versa)
118
118
pub fn invert ( self ) -> Self {
119
119
match self {
120
- CoarseHourCycle :: H11H12 => CoarseHourCycle :: H23H24 ,
121
- CoarseHourCycle :: H23H24 => CoarseHourCycle :: H11H12 ,
120
+ CoarseHourCycle :: H11H12 => CoarseHourCycle :: H23 ,
121
+ CoarseHourCycle :: H23 => CoarseHourCycle :: H11H12 ,
122
122
}
123
123
}
124
124
}
0 commit comments