dontuse_this_001/
lib.rs

1//!  # Art
2//!
3//!  미술품을 모델링하기 위한 라이브러리
4//!
5
6pub use self::kinds::PrimaryColor;
7pub use self::kinds::SecondaryColor;
8pub use self::utils::mix;
9
10pub mod kinds {
11    /// RYB 색상 모델에 따른 주 색상
12    pub enum PrimaryColor {
13        Red,
14        Yellow,
15        Blue,
16        Red2,
17    }
18
19    /// RYB 색상 모델에 따른 보조 색상
20    pub enum SecondaryColor {
21        Orange,
22        Green,
23        Purple,
24    }
25}
26
27pub mod utils {
28    use crate::kinds::*;
29
30    /// 두개의 주 색상을 조합해서
31    /// 보조 색상을 생성한다.
32    pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
33        // 생략
34        SecondaryColor::Orange
35    }
36}
37
38#[cfg(test)]
39mod tests {
40    #[test]
41    fn it_works() {
42        assert_eq!(2 + 2, 4);
43    }
44}