diff options
author | Adam Carpenter <adam.carpenter@adp.com> | 2019-02-11 16:59:01 -0500 |
---|---|---|
committer | Adam Carpenter <adam.carpenter@adp.com> | 2019-02-11 16:59:01 -0500 |
commit | ef1bf4921ee4127d461eec03a14c9070d193345c (patch) | |
tree | ab9f4ed73fcf97656743c959ce8c9adbe2ce9924 /packages | |
download | learning-rust-ef1bf4921ee4127d461eec03a14c9070d193345c.tar.xz learning-rust-ef1bf4921ee4127d461eec03a14c9070d193345c.zip |
Init.
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/my-project/.gitignore | 2 | ||||
-rwxr-xr-x | packages/my-project/Cargo.lock | 4 | ||||
-rwxr-xr-x | packages/my-project/Cargo.toml | 7 | ||||
-rwxr-xr-x | packages/my-project/src/main.rs | 82 | ||||
-rwxr-xr-x | packages/my-project/src/sound.rs | 1 | ||||
-rwxr-xr-x | packages/my-project/src/sound/instrument.rs | 3 |
6 files changed, 99 insertions, 0 deletions
diff --git a/packages/my-project/.gitignore b/packages/my-project/.gitignore new file mode 100755 index 0000000..53eaa21 --- /dev/null +++ b/packages/my-project/.gitignore @@ -0,0 +1,2 @@ +/target +**/*.rs.bk diff --git a/packages/my-project/Cargo.lock b/packages/my-project/Cargo.lock new file mode 100755 index 0000000..9679152 --- /dev/null +++ b/packages/my-project/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "my-project" +version = "0.1.0" + diff --git a/packages/my-project/Cargo.toml b/packages/my-project/Cargo.toml new file mode 100755 index 0000000..6edcb51 --- /dev/null +++ b/packages/my-project/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "my-project" +version = "0.1.0" +authors = ["Adam Carpenter <carpenat@ES.AD.ADP.COM>"] +edition = "2018" + +[dependencies] diff --git a/packages/my-project/src/main.rs b/packages/my-project/src/main.rs new file mode 100755 index 0000000..486ae46 --- /dev/null +++ b/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; +//} diff --git a/packages/my-project/src/sound.rs b/packages/my-project/src/sound.rs new file mode 100755 index 0000000..866ac56 --- /dev/null +++ b/packages/my-project/src/sound.rs @@ -0,0 +1 @@ +pub mod instrument; diff --git a/packages/my-project/src/sound/instrument.rs b/packages/my-project/src/sound/instrument.rs new file mode 100755 index 0000000..727784e --- /dev/null +++ b/packages/my-project/src/sound/instrument.rs @@ -0,0 +1,3 @@ +pub fn clarinet() { + println!("clarinet"); +} |