rd_test_arts/
lib.rs

1//! # Art
2//! 
3//! A library for modeling artistic concepts
4
5// In cases where there are many nested modules, re-exporting the types at the top level 
6// with pub use can make a significant difference in the experience of people who use the crate.
7pub use self::kinds::PrimaryColor;
8pub use self::kinds::SecondaryColor;
9pub use self::utils::mix;
10
11pub mod kinds {
12    /// The primary colors accroding to the RYB color model
13    pub enum PrimaryColor {
14        Red,
15        Yellow,
16        Blue,
17    }
18    
19    /// The secondary colors according to the RYB color model.
20    pub enum SecondaryColor {
21        Orange,
22        Green,
23        Purple,
24    }
25}
26
27pub mod utils {
28    use crate::kinds::*;
29
30    /// Combines two primary colors in equal amounts to create
31    /// a secondary color
32    pub fn mix (c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor{
33        SecondaryColor::Orange
34    }
35}
36
37#[cfg(test)]
38mod tests {
39    #[test]
40    fn it_works() {
41        assert_eq!(2 + 2, 4);
42    }
43}