rust_closures_examples/lib.rs
1//! # Art
2//!
3//! A library for modelling artistic concepts ...
4
5pub mod kinds {
6 /// the primary colors according to the RGB color model
7 #[derive(Debug)]
8 pub enum PrimaryColor {
9 Red,
10 Yellow,
11 Green,
12 }
13 /// the secondry color according to the RGB color model
14 #[derive(Debug)]
15 pub enum SecondryColor {
16 Orange,
17 Purple,
18 Black,
19 }
20}
21
22pub mod utils {
23 use crate::kinds::*;
24 /// combines two primary colors in equal amount to create
25 /// a secondry color
26 pub fn mix(c1: PrimaryColor, c2: SecondryColor) -> SecondryColor {
27 // --- snip ---
28 c2
29 }
30}