diff --git a/src/str.rs b/src/str.rs deleted file mode 100644 index fb32bd1..0000000 --- a/src/str.rs +++ /dev/null @@ -1,74 +0,0 @@ -//! Methods for applying composition and decomposition to strings and char iterators. - -pub use super::decompose::Decompositions; -pub use super::recompose::Recompositions; - - -/// Methods for iterating over strings while applying Unicode normalizations -/// as described in -/// [Unicode Standard Annex #15](http://www.unicode.org/reports/tr15/). -pub trait UnicodeNormalization> { - /// Returns an iterator over the string in Unicode Normalization Form D - /// (canonical decomposition). - #[inline] - fn nfd_chars(self) -> Decompositions; - - /// Returns an iterator over the string in Unicode Normalization Form KD - /// (compatibility decomposition). - #[inline] - fn nfkd_chars(self) -> Decompositions; - - /// An Iterator over the string in Unicode Normalization Form C - /// (canonical decomposition followed by canonical composition). - #[inline] - fn nfc_chars(self) -> Recompositions; - - /// An Iterator over the string in Unicode Normalization Form KC - /// (compatibility decomposition followed by canonical composition). - #[inline] - fn nfkc_chars(self) -> Recompositions; -} - -impl<'a> UnicodeNormalization> for &'a str { - #[inline] - fn nfd_chars(self) -> Decompositions> { - super::decompose::new_canonical(self.chars()) - } - - #[inline] - fn nfkd_chars(self) -> Decompositions> { - super::decompose::new_compatible(self.chars()) - } - - #[inline] - fn nfc_chars(self) -> Recompositions> { - super::recompose::new_canonical(self.chars()) - } - - #[inline] - fn nfkc_chars(self) -> Recompositions> { - super::recompose::new_compatible(self.chars()) - } -} - -impl> UnicodeNormalization for I { - #[inline] - fn nfd_chars(self) -> Decompositions { - super::decompose::new_canonical(self) - } - - #[inline] - fn nfkd_chars(self) -> Decompositions { - super::decompose::new_compatible(self) - } - - #[inline] - fn nfc_chars(self) -> Recompositions { - super::recompose::new_canonical(self) - } - - #[inline] - fn nfkc_chars(self) -> Recompositions { - super::recompose::new_compatible(self) - } -}