]> git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch14-more-about-cargo/listing-14-04/src/lib.rs
New upstream version 1.43.0+dfsg1
[rustc.git] / src / doc / book / listings / ch14-more-about-cargo / listing-14-04 / src / lib.rs
1 //! # Art
2 //!
3 //! A library for modeling artistic concepts.
4
5 pub 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
21 pub 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 SecondaryColor::Orange
28 }
29 }