Skip to content

Commit

Permalink
Fix test builds on non-nightly
Browse files Browse the repository at this point in the history
Apparently nightly is smarter when determining how to enclose doctests
statements into `fn main() { ... }` and that's why only nightly's build
succeeded.
  • Loading branch information
hcpl committed Apr 9, 2018
1 parent 102b526 commit 3f2c4c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,14 @@ pub fn apply_rng_iter<R: Rng, I: Iterator<Item = char>>(
/// use rand::Isaac64Rng;
/// use zalgo::{CharKind, Intensity};
///
/// # fn main() {
/// let rng = Isaac64Rng::new_unseeded();
/// let intensity = Intensity::Custom { up: 100, middle: 100, down: 100 };
/// let applied = zalgo::apply_rng(rng, "test", CharKind::all(), intensity);
/// let unapplied = zalgo::unapply(&applied);
///
/// assert_eq!(&unapplied, "test");
/// # }
/// ```
#[cfg(any(feature = "std", feature = "alloc"))]
pub fn unapply(text: &str) -> String {
Expand All @@ -429,12 +431,14 @@ pub fn unapply(text: &str) -> String {
/// use rand::Isaac64Rng;
/// use zalgo::{CharKind, Intensity};
///
/// # fn main() {
/// let rng = Isaac64Rng::new_unseeded();
/// let intensity = Intensity::Custom { up: 100, middle: 100, down: 100 };
/// let applied = zalgo::apply_rng_iter(rng, "text".chars(), CharKind::all(), intensity);
/// let unapplied = zalgo::unapply_iter(applied);
///
/// assert!(unapplied.eq("text".chars()));
/// # }
/// ```
///
/// [`Iterator`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html
Expand Down

0 comments on commit 3f2c4c0

Please sign in to comment.