Skip to content

Instantly share code, notes, and snippets.

@caulagi
Last active December 20, 2016 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caulagi/7994c04f7216529748143f865d637d3a to your computer and use it in GitHub Desktop.
Save caulagi/7994c04f7216529748143f865d637d3a to your computer and use it in GitHub Desktop.
hello-world rust
$ 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!
[package]
name = "hello-world"
version = "0.1.0"
authors = ["Pradip Caulagi <caulagi@gmail.com>"]
[dependencies]
fn main() {
println!("Hello, world!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment