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 ).
6 /// An attribute used in a set of [`Attributes`](super::Attributes).
8 /// An attribute has to be a sequence of alphanumerical characters no
9 /// shorter than three and no longer than eight characters.
15 /// use icu::locid::extensions::unicode::Attribute;
16 /// use icu::locid::extensions_unicode_attribute as attribute;
18 /// let attr: Attribute =
19 /// "buddhist".parse().expect("Failed to parse an Attribute.");
21 /// assert_eq!(attr, attribute!("buddhist"));
24 extensions
::unicode
::Attribute
,
25 extensions_unicode_attribute
,
28 s
.is_ascii_alphanumeric(),
29 s
.to_ascii_lowercase(),
30 s
.is_ascii_alphanumeric() && s
.is_ascii_lowercase(),