Browse Source

Add cargo example project, update README & gitignore

Emilio González Montaña 4 years ago
parent
commit
d12f419c07
4 changed files with 27 additions and 1 deletions
  1. 3 0
      .gitignore
  2. 9 0
      Cargo.toml
  3. 12 1
      README.md
  4. 3 0
      src/main.rs

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/.idea/
+/target/
+/Cargo.lock

+ 9 - 0
Cargo.toml

@@ -0,0 +1,9 @@
+[package]
+name = "cargo-hello-world"
+version = "0.1.0"
+authors = ["Emilio González Montaña <emilio@ociotec.com>"]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]

+ 12 - 1
README.md

@@ -1,2 +1,13 @@
-# 02-cargo-hello-world
+# 02 - Cargo  hello world
 
+## Create cargo project
+
+```
+cargo new cargo-hello-world --bin
+```
+
+## Build & run
+
+```
+cargo run
+```

+ 3 - 0
src/main.rs

@@ -0,0 +1,3 @@
+fn main() {
+    println!("Hello, world!");
+}