pedrov 0.2.0

A test crate for the Rust book.
Documentation
// Documentation comments are declared with three `/`s.

// It generates HTML and supports Markdown.
// This can be done and opened with `cargo doc --open`. It generates this for all crates in the
// package, internal and external.

// Usually, they contain:
// - Description: Short summary.
// - Examples: Important, useful examples.
// - Panics: Situation where the code panics.
// - Errors: About the E in Result<T, E>.
// - Safety: If the function uses unsafe, why and which variants are expected.

// Example code blocks in the comments are also ran with `cargo test`.

// Documentation comments can apply to the item that contains the comment, using //!

//! # Pedrov
//!
//! `pedrov` is a collection of utilities to make performing certain
//! calculations more convenient.

/// Adds one to the number given.
///
/// # Examples
///
/// ```
/// let arg = 5;
/// let answer = pedrov::add_one(arg);
///
/// assert_eq!(6, answer);
/// ```
pub fn add_one(x: i32) -> i32 {
    x + 1
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_add_one() {
        assert_eq!(add_one(1), 2);
    }
}