lrust/
lib.rs

1//! lrust
2//!
3//! ‘lrust’ is abbreviation that stands as ‘learn rust’
4//!
5pub use self::kinds::PrimaryColor;
6pub use self::kinds::SecondaryColor;
7pub use self::utils::mix;
8
9pub mod kinds {
10    /// The primary colors according to the RYB color model.
11    pub enum PrimaryColor {
12        Red,
13        Yellow,
14        Blue,
15    }
16
17    /// The secondary colors according to the RYB color model.
18    pub enum SecondaryColor {
19        Orange,
20        Green,
21        Purple,
22    }
23}
24pub mod utils {
25    use crate::kinds::*;
26
27    /// Combines two primary colors in equal amounts to create
28    /// a secondary color.
29    pub fn mix(prim_col1: PrimaryColor, prim_col2: PrimaryColor) -> SecondaryColor {
30        SecondaryColor::Green
31    }
32}