//! #crates //! //! 'crates' is a collection of utilities to make performing certain //! calculations more convenient. /// Adds one to the number given /// /// # Examples /// /// ``` /// let arg = 5; /// let answer = my_crate::add_one(arg); /// /// assert_eq!(6, answer); /// ``` pub fn add_one(x: i32) -> i32 { x + 1 } pub use self::kinds::Primary_Color; pub use self::kinds::Secondary_Color; pub use self::utils::mix; pub mod kinds { ///The primary colors according to RYB color model pub enum Primary_Color { Red, Yellow, Blue, } ///The secondary colors according to RYB color model pub enum Secondary_Color { Orange, Green, Purple, } } pub mod utils { use crate::kinds::*; ///Combines 2 primary colors in equal amounts to create a secondary color pub fn mix(c1: Primary_Color, c2: Primary_Color) -> Secondary_Color { // --snip-- // ANCHOR_END: here Secondary_Color::Orange // ANCHOR: here } }