Skip to content

Commit 5410d39

Browse files
fix: build error
1 parent 7b8c64e commit 5410d39

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,12 @@ pub fn x520prep(s: &str, case_fold: bool) -> Result<Cow<'_, str>, Error> {
345345
// From ITU-T Recommendation X.520, Section 7.4:
346346
// "The first code point of a string is prohibited from being a combining character."
347347
let first_char = s.chars().next();
348-
if first_char.is_some_and(|c| tables::unicode_mark_category(c)) {
349-
// I do think this ought to be considered a different error, but adding
350-
// another enum variant would be a breaking change, so this is "good"
351-
return Err(Error(ErrorCause::ProhibitedCharacter(first_char.unwrap())));
348+
if let Some(c) = first_char {
349+
if tables::unicode_mark_category(c) {
350+
// I do think this ought to be considered a different error, but adding
351+
// another enum variant would be a breaking change, so this is "good"
352+
return Err(Error(ErrorCause::ProhibitedCharacter(first_char.unwrap())));
353+
}
352354
}
353355

354356
// 5. Check bidi

0 commit comments

Comments
 (0)