Skip to content

Commit c4ecf50

Browse files
committed
fmt
1 parent 7780ad4 commit c4ecf50

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

components/datetime/src/provider/packed_pattern.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,59 +30,59 @@ pub struct PackedSkeletonDataBuilder<'a> {
3030
size_test!(PackedSkeletonDataV2, packed_skeleton_data_size, 32);
3131

3232
/// Main data struct for packed datetime patterns.
33-
///
33+
///
3434
/// ## Variants
35-
///
35+
///
3636
/// This supports a set of "standard" patterns plus up to two "variants".
3737
/// The variants are currently used by year formatting:
38-
///
38+
///
3939
/// - Standard: Year, which could be partial precision (2-digit Gregorain)
4040
/// - Variant 0: Full Year, which is always full precision
4141
/// - Variant 1: Year With Era
42-
///
42+
///
4343
/// Variants should be used when the pattern could depend on the value being
4444
/// formatted. For example, with [`EraDisplay::Auto`], any of these three
4545
/// patterns could be selected based on the year value.
46-
///
46+
///
4747
/// ## Representation
48-
///
48+
///
4949
/// Currently, there are at most 9 patterns that need to be stored together,
5050
/// named according to this table:
51-
///
51+
///
5252
/// | | Standard | Variant 0 | Variant 1 |
5353
/// |--------|----------|-----------|-----------|
5454
/// | Long | La | Lb | Lc |
5555
/// | Medium | Ma | Mb | Mc |
5656
/// | Short | Sa | Sb | Sc |
57-
///
57+
///
5858
/// The header byte encodes which pattern in the patterns array corresponds to
5959
/// a particular cell in the table. It contains the following information:
60-
///
60+
///
6161
/// - Bits 0-1: "LMS" value of the standard column
6262
/// - Bit 2: "Q" value: 1 for directly-indexed variants; 0 for per-cell offsets
6363
/// - Bits 3-20: Packed offset into patterns table for each variant cell
6464
/// - Bits 21-31: unused/reserved
65-
///
65+
///
6666
/// The LMS value determines which pattern index is used for the first column:
67-
///
67+
///
6868
/// | LMS Value | Long Index | Medium Index | Short Index |
6969
/// |-----------|------------|--------------|-------------|
7070
/// | 0 | 0 | 0 | 0 |
7171
/// | 1 | 0 | 1 | 1 |
7272
/// | 2 | 0 | 0 | 1 |
7373
/// | 3 | 0 | 1 | 2 |
74-
///
74+
///
7575
/// If bit 2 is 1 (Q=1), it means there is one pattern per variant index,
7676
/// with the index offset by the short index `S` from the table above.
7777
/// However, this requires storing multiple, possibly duplicate, patterns in
7878
/// the packed structure. The more common case is Q=0 and then to store
7979
/// per-cell offsets in chunks of 3 bits per cell:
80-
///
80+
///
8181
/// - Chunk = 0: Inherit according to the table below
8282
/// - Chunk = 1-7: Use pattern index Chunk - 1
83-
///
83+
///
8484
/// This is summarized below:
85-
///
85+
///
8686
/// | Cell in Table | Q=1 Pattern Index | Q=0 Header Bits | Inheritance |
8787
/// |---------------|-------------------|-----------------|-------------|
8888
/// | Lb | S + 1 | 3-5 | La |

0 commit comments

Comments
 (0)