diff options
author | Adam Carpenter <53hornet@gmail.com> | 2019-03-27 15:32:37 -0400 |
---|---|---|
committer | Adam Carpenter <53hornet@gmail.com> | 2019-03-27 15:32:37 -0400 |
commit | 67cdcc2e12118becb823e20a40cc2687f2b8425a (patch) | |
tree | ed92c3234b89079e6d4cf36f5e80c5ffa79def48 /crates/src | |
parent | e25482fca375d318a39c3b54db396b0db6e0b263 (diff) | |
download | learning-rust-67cdcc2e12118becb823e20a40cc2687f2b8425a.tar.xz learning-rust-67cdcc2e12118becb823e20a40cc2687f2b8425a.zip |
Started Rust in Action MEAP.
Diffstat (limited to 'crates/src')
-rw-r--r-- | crates/src/lib.rs | 33 | ||||
-rw-r--r-- | crates/src/main.rs | 8 |
2 files changed, 0 insertions, 41 deletions
diff --git a/crates/src/lib.rs b/crates/src/lib.rs deleted file mode 100644 index 5cf1d97..0000000 --- a/crates/src/lib.rs +++ /dev/null @@ -1,33 +0,0 @@ -//! # Art -//! -//! A library for modeling artistic concepts. - -pub use kinds::PrimaryColor; -pub use kinds::SecondaryColor; -pub use utils::mix; - -pub mod kinds { - /// The primary colors according to the RYB color model. - pub enum PrimaryColor { - Red, - Yellow, - Blue, - } - - /// The secondary colors according to the RYB color model. - pub enum SecondaryColor { - Orange, - Green, - Purple, - } -} - -pub mod utils { - use crate::kinds::*; - - /// Combines two primary color in equal amounts to create - /// a secondary color. - pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor { - SecondaryColor::Green - } -} diff --git a/crates/src/main.rs b/crates/src/main.rs deleted file mode 100644 index 80668f2..0000000 --- a/crates/src/main.rs +++ /dev/null @@ -1,8 +0,0 @@ -use art::PrimaryColor; -use art::mix; - -fn main() { - let red = PrimaryColor::Red, - let yellow = PrimaryColor::Yellow; - mix(red, yellow); -} |