From 7e8ee5ed9cad6484e9f13f81731b102ced58402e Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 9 Jul 2019 15:14:04 -0400 Subject: Init. --- rust-book/packages/my-project/src/main.rs | 82 +++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100755 rust-book/packages/my-project/src/main.rs (limited to 'rust-book/packages/my-project/src/main.rs') diff --git a/rust-book/packages/my-project/src/main.rs b/rust-book/packages/my-project/src/main.rs new file mode 100755 index 0000000..486ae46 --- /dev/null +++ b/rust-book/packages/my-project/src/main.rs @@ -0,0 +1,82 @@ +mod sound; + +fn main() { + crate::sound::instrument::clarinet(); + sound::instrument::clarinet(); +} +//mod sound { +// pub mod instrument { +// pub mod woodwind { +// +// pub fn clarinet() { +// println!("clarinet"); +// } +// +// } +// +// pub mod string { +// +// pub fn guitar() { +// println!("guitar"); +// super::woodwind::clarinet(); +// } +// +// } +// +// } +// +// mod voice { +// } +// +//} +// +//mod performance_group { +// pub use crate::sound::instrument::woodwind; +// +// pub fn clarinet_trio() { +// woodwind::clarinet(); +// woodwind::clarinet(); +// woodwind::clarinet(); +// } +// +//} +// +//fn main() { +// performance_group::clarinet_trio(); +// performance_group::woodwind::clarinet(); +//} + +//mod plant { +// pub struct Vegetable { +// pub name: String, +// id: i32, +// } +// +// impl Vegetable { +// pub fn new(name: &str) -> Vegetable { +// Vegetable { +// name: String::from(name), +// id: 1, +// } +// } +// } +//} +// +//fn main() { +// let mut v = plant::Vegetable::new("squash"); +// v.name = String::from("butternut squash"); +// println!("{} are delicious", v.name); +// //println!("The id is: {}", v.id); +//} + +//mod menu { +// pub enum Appetizer { +// Soup, +// Salad, +// } +//} +// +//fn main() { +// let order1 = menu::Appetizer::Soup; +// let order2 = menu::Appetizer::Salad; +//} -- cgit v1.2.3