Skip to content

Commit 58edcc6

Browse files
authored
Merge pull request #9 from LecrisUT/remove_dependence
Replace `finl_unicode` with `unicode-properties`
2 parents 6b6bbbe + a7b404d commit 58edcc6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ repository = "https://github.com/sfackler/rust-stringprep"
88
readme = "README.md"
99

1010
[dependencies]
11-
finl_unicode = "1.2.0"
1211
unicode-bidi = "0.3"
1312
unicode-normalization = "0.1"
13+
unicode-properties = "0.1.1"

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
//!
33
//! [RFC 3454]: https://tools.ietf.org/html/rfc3454
44
#![warn(missing_docs)]
5-
extern crate finl_unicode;
65
extern crate unicode_bidi;
76
extern crate unicode_normalization;
7+
extern crate unicode_properties;
88

9-
use finl_unicode::categories::CharacterCategories;
109
use std::borrow::Cow;
1110
use std::fmt;
1211
use unicode_normalization::UnicodeNormalization;
12+
use unicode_properties::{GeneralCategoryGroup, UnicodeGeneralCategory};
1313

1414
mod rfc3454;
1515
pub mod tables;
@@ -353,7 +353,7 @@ pub fn x520prep(s: &str, case_fold: bool) -> Result<Cow<'_, str>, Error> {
353353
// "The first code point of a string is prohibited from being a combining character."
354354
match s.chars().next() {
355355
Some(c) => {
356-
if c.is_mark() {
356+
if c.general_category_group() == GeneralCategoryGroup::Mark {
357357
return Err(Error(ErrorCause::StartsWithCombiningCharacter));
358358
}
359359
}

src/tables.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Character Tables
2-
use finl_unicode::categories::CharacterCategories;
32
use std::cmp::Ordering;
43
use std::str::Chars;
54
use unicode_bidi::{bidi_class, BidiClass};
5+
use unicode_properties::{GeneralCategoryGroup, UnicodeGeneralCategory};
66

77
use super::rfc3454;
88

@@ -246,6 +246,6 @@ pub fn x520_mapped_to_nothing(c: char) -> bool {
246246
pub fn x520_mapped_to_space(c: char) -> bool {
247247
match c {
248248
'\u{09}' | '\u{0A}'..='\u{0D}' | '\u{85}' => true,
249-
_ => c.is_separator(),
249+
_ => c.general_category_group() == GeneralCategoryGroup::Separator,
250250
}
251251
}

0 commit comments

Comments
 (0)