Skip to content

Commit

Permalink
Merge pull request #21 from artichoke/doc-rendering-readme-docs.rs
Browse files Browse the repository at this point in the history
Fix README example and crate-level docs example rendering
  • Loading branch information
lopopolo authored Feb 15, 2021
2 parents e25ce89 + 78e46dd commit 6f2a8b8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 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.1" # remember to set `html_root_url` in `src/lib.rs`.
version = "0.0.2" # remember to set `html_root_url` in `src/lib.rs`.
authors = ["Ryan Lopopolo <[email protected]>"]
license = "MIT"
edition = "2018"
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,22 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
roe = "0.0.1"
roe = "0.0.2"
```

Then convert case like:

```rust
use roe::{LowercaseMode, UppercaseMode};

assert_eq!(roe::lowercase(b"Artichoke Ruby", LowercaseMode::Ascii).collect::<Vec<_>>(), b"artichoke ruby");
assert_eq!(roe::uppercase("Αύριο".as_bytes(), UppercaseMode::Full).collect::<Vec<_>>(), "ΑΎΡΙΟ".as_bytes());
assert_eq!(
roe::lowercase(b"Artichoke Ruby", LowercaseMode::Ascii).collect::<Vec<_>>(),
b"artichoke ruby"
);
assert_eq!(
roe::uppercase("Αύριο".as_bytes(), UppercaseMode::Full).collect::<Vec<_>>(),
"ΑΎΡΙΟ".as_bytes()
);
```

## Crate Features
Expand Down
12 changes: 9 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@
//!
//! ```
//! # use roe::{LowercaseMode, UppercaseMode};
//! assert_eq!(roe::lowercase(b"Artichoke Ruby", LowercaseMode::Ascii).collect::<Vec<_>>(), b"artichoke ruby");
//! assert_eq!(roe::uppercase("Αύριο".as_bytes(), UppercaseMode::Full).collect::<Vec<_>>(), "ΑΎΡΙΟ".as_bytes());
//! assert_eq!(
//! roe::lowercase(b"Artichoke Ruby", LowercaseMode::Ascii).collect::<Vec<_>>(),
//! b"artichoke ruby"
//! );
//! assert_eq!(
//! roe::uppercase("Αύριο".as_bytes(), UppercaseMode::Full).collect::<Vec<_>>(),
//! "ΑΎΡΙΟ".as_bytes()
//! );
//! ```
//!
//!
Expand Down Expand Up @@ -72,7 +78,7 @@
//! [`Vec`]: https://doc.rust-lang.org/alloc/vec/struct.Vec.html
#![no_std]
#![doc(html_root_url = "https://docs.rs/roe/0.0.1")]
#![doc(html_root_url = "https://docs.rs/roe/0.0.2")]

#[cfg(any(feature = "alloc", test))]
extern crate alloc;
Expand Down

0 comments on commit 6f2a8b8

Please sign in to comment.