Skip to content

Commit

Permalink
Merge pull request #157 from artichoke/lopopolo/fixup-titlecase-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lopopolo authored Dec 9, 2023
2 parents 7209421 + 1354f09 commit 9e01d93
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "MIT"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
roe = "0.0.5"
roe = "0.0.6"
```

Then convert case like:
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/unicode/titlecase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
///
Expand All @@ -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] {
Expand Down

0 comments on commit 9e01d93

Please sign in to comment.