rust_lang_chapter14_tutorial/
lib.rs

1//! # Art
2//!
3//! A library for modeling artistic concepts.
4
5pub mod kinds {
6    /// The primary colors according to the RYB color model.
7    pub enum PrimaryColor {
8        Red,
9        Yellow,
10        Blue,
11    }
12
13    /// The secondary colors according to the RYB color model.
14    pub enum SecondaryColor {
15        Orange,
16        Green,
17        Purple,
18    }
19}
20
21pub mod utils {
22    use crate::kinds::*;
23
24    /// Combines two primary colors in equal amounts to create
25    /// a secondary color.
26    pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
27        // --snip--
28        // ANCHOR_END: here
29        SecondaryColor::Orange
30        // ANCHOR: here
31    }
32}