diff --git a/Cargo.toml b/Cargo.toml index bac78d2..62a9002 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,6 @@ repository = "https://github.com/sfackler/rust-stringprep" readme = "README.md" [dependencies] -finl_unicode = "1.2.0" unicode-bidi = "0.3" unicode-normalization = "0.1" +unicode-properties = "0.1.1" diff --git a/src/lib.rs b/src/lib.rs index 9c58bd8..7027761 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,14 +2,14 @@ //! //! [RFC 3454]: https://tools.ietf.org/html/rfc3454 #![warn(missing_docs)] -extern crate finl_unicode; extern crate unicode_bidi; extern crate unicode_normalization; +extern crate unicode_properties; -use finl_unicode::categories::CharacterCategories; use std::borrow::Cow; use std::fmt; use unicode_normalization::UnicodeNormalization; +use unicode_properties::{GeneralCategoryGroup, UnicodeGeneralCategory}; mod rfc3454; pub mod tables; @@ -353,7 +353,7 @@ pub fn x520prep(s: &str, case_fold: bool) -> Result, Error> { // "The first code point of a string is prohibited from being a combining character." match s.chars().next() { Some(c) => { - if c.is_mark() { + if c.general_category_group() == GeneralCategoryGroup::Mark { return Err(Error(ErrorCause::StartsWithCombiningCharacter)); } } diff --git a/src/tables.rs b/src/tables.rs index 9ced79f..3eccb35 100644 --- a/src/tables.rs +++ b/src/tables.rs @@ -1,8 +1,8 @@ //! Character Tables -use finl_unicode::categories::CharacterCategories; use std::cmp::Ordering; use std::str::Chars; use unicode_bidi::{bidi_class, BidiClass}; +use unicode_properties::{GeneralCategoryGroup, UnicodeGeneralCategory}; use super::rfc3454; @@ -246,6 +246,6 @@ pub fn x520_mapped_to_nothing(c: char) -> bool { pub fn x520_mapped_to_space(c: char) -> bool { match c { '\u{09}' | '\u{0A}'..='\u{0D}' | '\u{85}' => true, - _ => c.is_separator(), + _ => c.general_category_group() == GeneralCategoryGroup::Separator, } }