-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44fbb23
commit cefe3c6
Showing
11 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
*.png | ||
rust/target/ | ||
docker/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
target/ | ||
*.lock |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fn main() { | ||
println!("Hello, World!"); | ||
println!("I'm a Rustacean!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Install https://rustup.rs/ | ||
Install https://crates.io/crates/cargo-edit/ | ||
|
||
Creating a new project: | ||
$ cargo new <dir_name> | ||
|
||
This will create a Cargo.toml (similar to package.json for JS projects) and a src/main.rs | ||
If not specified, cargo will assume that the project is a binary. By convention, src/main.rs is a entrypoint for a binary (just like index.js for JS projects) | ||
|
||
|
||
To run a binary: | ||
project_root$ cargo run | ||
|
||
To compile: | ||
$ rustc <file_name.rs> | ||
|
||
To execute: | ||
$ ./file_name | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "weather-cli" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
fn main() { | ||
let api_token: String = std::env::var("API_TOKEN") | ||
.expect("expected there to be an api token"); | ||
|
||
dbg! (api_token); | ||
|
||
|
||
// enum Result<THING_WE_WANT, ERROR_THAT_COULD_HAPPEN> { | ||
// Ok(THING_WE_WANT), | ||
// Err(ERROR_THAT_COULD_HAPPEN) | ||
// } | ||
} |