rust-lab-1 0.1.1

A fun game where you guess what number the computer has chosen.
Documentation
//! # Rust-Lab
//!
//! `my_crate` is a collection of utilities to make performing certain
//! calculations more convenient.

/// Adds one to the number given.
///
/// # Panics
/// # Safety
/// # Examples
///
/// ```
/// let arg = 5;
/// let answer = rust_lab::add_one(arg);
///
/// assert_eq!(6, answer);
/// ```
pub fn add_one(x: i32) -> i32 {
    x + 1
}
/// Adds one to the number given.
///
/// # Panics
/// # Safety
/// # Examples
///
/// ```
/// let arg = 5;
/// let answer = rust_lab::add_two(arg);
///
/// assert_eq!(7, answer);
/// ```
pub fn add_two(a: i32) -> i32 {
    internal_adder(a, 2)
}
/// Adds one to the number given.
///
/// # Panics
/// # Safety
/// # Examples
///
/// ```
/// let arg_1 = 5;
/// let arg_2 = 5;
/// let answer = rust_lab::internal_adder(arg_1,arg_2);
///
/// assert_eq!(10, answer);
///
pub fn internal_adder(a: i32, b: i32) -> i32 {
    a + b
}

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

    #[test]
    fn internal() {
        assert_eq!(4, internal_adder(2, 2));
    }
}

pub use self::kinds::PrimaryColor;
pub use self::kinds::SecondaryColor;
pub use self::utils::mix;

pub mod kinds {
    /// The primary colors according to the RYB color model.
    pub enum PrimaryColor {
        Red,
        Yellow,
        Blue,
    }

    /// The secondary colors according to the RYB color model.
    pub enum SecondaryColor {
        Orange,
        Green,
        Purple,
    }
}

pub mod utils {
    use crate::kinds::*;

    /// Combines two primary colors in equal amounts to create
    /// a secondary color.
    pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
        SecondaryColor::Orange
    }
}