• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zbraniecki / icu4x / 13958601093

19 Mar 2025 04:17PM UTC coverage: 74.164% (-1.5%) from 75.71%
13958601093

push

github

web-flow
Clean up properties docs (#6315)

58056 of 78281 relevant lines covered (74.16%)

819371.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/components/datetime/src/provider/pattern/error.rs
1
// This file is part of ICU4X. For terms of use, please see the file
2
// called LICENSE at the top level of the ICU4X source tree
3
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4

5
use crate::provider::fields;
6
use displaydoc::Display;
7

8
/// A low-level pattern parsing error.
9
///
10
/// These strings follow the recommendations for the serde::de::Unexpected::Other type.
11
/// <https://docs.serde.rs/serde/de/enum.Unexpected.html#variant.Other>
12
///
13
/// Serde will generate an error such as:
14
/// "invalid value: unclosed literal in pattern, expected a valid UTS 35 pattern string at line 1 column 12"
15
#[derive(Display, Debug, PartialEq, Copy, Clone)]
16✔
16
#[allow(missing_docs)]
17
#[non_exhaustive]
18
pub enum PatternError {
19
    #[displaydoc("{0:?} invalid field length in pattern")]
20
    FieldLengthInvalid(fields::FieldSymbol),
2✔
21
    #[displaydoc("unknown substitution {0} in pattern")]
×
22
    UnknownSubstitution(char),
2✔
23
    #[displaydoc("invalid symbol {0} in pattern")]
×
24
    InvalidSymbol(char),
×
25
    #[displaydoc("unclosed literal in pattern")]
26
    UnclosedLiteral,
27
    #[displaydoc("unclosed placeholder in pattern")]
28
    UnclosedPlaceholder,
29
    #[displaydoc("plural pattern variants are only supported for week-of-month and week-of-year")]
30
    UnsupportedPluralPivot,
31
}
32

33
impl core::error::Error for PatternError {}
34

35
impl From<fields::Error> for PatternError {
36
    fn from(input: fields::Error) -> Self {
×
37
        match input {
38
            fields::Error::InvalidLength(symbol) => Self::FieldLengthInvalid(symbol),
×
39
        }
40
    }
×
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc