diff options
Diffstat (limited to 'add/adder')
-rw-r--r-- | add/adder/.gitignore | 18 | ||||
-rw-r--r-- | add/adder/Cargo.toml | 10 | ||||
-rw-r--r-- | add/adder/src/main.rs | 10 |
3 files changed, 38 insertions, 0 deletions
diff --git a/add/adder/.gitignore b/add/adder/.gitignore new file mode 100644 index 0000000..e629269 --- /dev/null +++ b/add/adder/.gitignore @@ -0,0 +1,18 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/rust +# Edit at https://www.toptal.com/developers/gitignore?templates=rust + +### Rust ### +# Generated by Cargo +# will have compiled files and executables +/target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# End of https://www.toptal.com/developers/gitignore/api/rust + diff --git a/add/adder/Cargo.toml b/add/adder/Cargo.toml new file mode 100644 index 0000000..91118cb --- /dev/null +++ b/add/adder/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "adder" +version = "0.1.0" +authors = ["Jordan Gong <jordan.gong@protonmail.com>"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +add-one = { path = "../add-one" } diff --git a/add/adder/src/main.rs b/add/adder/src/main.rs new file mode 100644 index 0000000..7deb796 --- /dev/null +++ b/add/adder/src/main.rs @@ -0,0 +1,10 @@ +use add_one; + +fn main() { + let num = 10; + println!( + "Hello, world! {} plus one is {}!", + num, + add_one::add_one(num) + ); +} |