Last active
December 20, 2016 19:36
-
-
Save caulagi/7994c04f7216529748143f865d637d3a to your computer and use it in GitHub Desktop.
hello-world rust
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
$ rustup show | |
Default host: x86_64-apple-darwin | |
installed toolchains | |
-------------------- | |
stable-x86_64-apple-darwin | |
beta-x86_64-apple-darwin | |
nightly-x86_64-apple-darwin (default) | |
active toolchain | |
---------------- | |
nightly-x86_64-apple-darwin (default) | |
rustc 1.15.0-nightly (daf8c1dfc 2016-12-05) | |
# create a hello-world binary | |
$ cargo new hello-world --bin | |
$ cd hello-world | |
$ tree | |
. | |
├── Cargo.toml | |
└── src | |
└── main.rs | |
1 directory, 2 files | |
$ cargo build | |
Compiling hello-world v0.1.0 (file:///private/tmp/hello-world) | |
Finished debug [unoptimized + debuginfo] target(s) in 3.30 secs | |
$ cargo run | |
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs | |
Running `target/debug/hello-world` | |
Hello, world! |
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
[package] | |
name = "hello-world" | |
version = "0.1.0" | |
authors = ["Pradip Caulagi <caulagi@gmail.com>"] | |
[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
fn main() { | |
println!("Hello, world!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment