diff --git a/Cargo.toml b/Cargo.toml index 6e2e0c785..b679216a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "roe" -version = "0.0.5" # remember to set `html_root_url` in `src/lib.rs`. +version = "0.0.6" # remember to set `html_root_url` in `src/lib.rs`. authors = ["Ryan Lopopolo "] license = "MIT" edition = "2018" diff --git a/README.md b/README.md index cd3ccede3..1c92260d8 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -roe = "0.0.5" +roe = "0.0.6" ``` Then convert case like: diff --git a/src/lib.rs b/src/lib.rs index e3f212028..e43f65b3c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,7 +100,7 @@ //! [conventionally UTF-8 binary strings]: https://docs.rs/bstr/1.*/bstr/#when-should-i-use-byte-strings #![no_std] -#![doc(html_root_url = "https://docs.rs/roe/0.0.5")] +#![doc(html_root_url = "https://docs.rs/roe/0.0.6")] #[cfg(any(feature = "alloc", test))] extern crate alloc; @@ -566,8 +566,8 @@ impl FromStr for TitlecaseMode { } /// Returns an iterator that yields a copy of the bytes in the given slice with -/// the leading letter replaced with their titlecase counterpart, and rest -/// letters replaced with their titlecase counterparts. +/// the leading letter replaced with its titlecase counterpart and all remaining +/// letters replaced with their lowercase counterparts. /// /// This function treats the given slice as a [conventionally UTF-8 string]. /// UTF-8 byte sequences are converted to their Unicode titlecase equivalents. diff --git a/src/unicode/titlecase.rs b/src/unicode/titlecase.rs index 151412928..24bbe3d03 100644 --- a/src/unicode/titlecase.rs +++ b/src/unicode/titlecase.rs @@ -2,12 +2,14 @@ use crate::unicode::std_case_mapping_iter::CaseMappingIter; use crate::unicode::ucd_generated_case_mapping::SORTED_TITLECASE_MAPPING; use core::iter::FusedIterator; -/// Take a char and return its Unicode titlecase as 3 chars. +/// Take a [`char`] and return its Unicode titlecase as 3 `char`s. +/// +/// Trailing NUL bytes in the returned array should be ignored. /// /// # Examples /// /// ``` -/// # use roe::to_titlecase; +/// use roe::to_titlecase; /// /// assert_eq!(to_titlecase('DŽ'), ['Dž', '\0', '\0']); /// @@ -20,8 +22,6 @@ use core::iter::FusedIterator; /// // A character already titlecased map to itself /// assert_eq!(to_titlecase('A'), ['A', '\0', '\0']); /// ``` -/// -/// [Ruby `ArgumentError` Exception class]: https://ruby-doc.org/core-3.1.2/ArgumentError.html #[allow(clippy::module_name_repetitions)] #[must_use] pub fn to_titlecase(c: char) -> [char; 3] {