art22_05_23/
lib.rs

1//! # Art
2//!
3//! A library for modling artistic concepts
4
5pub use self::kinds::PrimaryColor;
6pub use self::kinds::SecondaryColor;
7pub use self::utils::mix;
8
9pub mod kinds {
10    /// The primary colors in the RYB color space
11    pub enum PrimaryColor {
12        Red,
13        Yellow,
14        Blue,
15    }
16
17    /// The secondary colors in the RYB color space
18    pub enum SecondaryColor {
19        Orange,
20        Green,
21        Purple,
22    }
23}
24
25pub mod utils {
26    use crate::kinds::*;
27
28    /// Combines two primary colors in equal amounts to create
29    /// a secondary color
30    pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
31        SecondaryColor::Orange
32    }
33}
34
35#[cfg(test)]
36mod tests {
37    #[test]
38    fn it_works() {
39        let result = 2 + 2;
40        assert_eq!(result, 4);
41    }
42}