diff options
| author | mo khan <mo@mokhan.ca> | 2023-02-13 13:52:54 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2023-02-13 13:52:54 -0700 |
| commit | 55d93534e21f67c50f5927e1291cd4c94234b0c9 (patch) | |
| tree | 8250adfb0ca8ec4c5459f1f368cdb1e0a6f09e63 | |
| parent | a0b6be5ba530105dd13de0842996ad3a3ef7e599 (diff) | |
Add notes on cargo
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | 1.3/hello_cargo/Cargo.lock | 7 | ||||
| -rw-r--r-- | 1.3/hello_cargo/Cargo.toml | 8 | ||||
| -rw-r--r-- | 1.3/hello_cargo/src/main.rs | 3 | ||||
| -rw-r--r-- | README.md | 33 |
5 files changed, 52 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f7896d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/1.3/hello_cargo/Cargo.lock b/1.3/hello_cargo/Cargo.lock new file mode 100644 index 0000000..dd1d0bb --- /dev/null +++ b/1.3/hello_cargo/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "hello_cargo" +version = "0.1.0" diff --git a/1.3/hello_cargo/Cargo.toml b/1.3/hello_cargo/Cargo.toml new file mode 100644 index 0000000..19c7b36 --- /dev/null +++ b/1.3/hello_cargo/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "hello_cargo" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/1.3/hello_cargo/src/main.rs b/1.3/hello_cargo/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/1.3/hello_cargo/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} @@ -1,2 +1,35 @@ +# Rust Langugage current: https://doc.rust-lang.org/book/ch01-01-installation.html + +# Shell + +Compile a single file. + +```bash +$ rustc main.rs +``` + +Create a new cargo project: + +```bash +$ cargo new hello_world +``` + +Build a cargo project: + +```bash +$ cargo build +``` + +Run a cargo project: + +```bash +$ cargo run +``` + +Check for errors in a cargo project: + +```bash +$ cargo check +``` |
