From 2cba306b8d3dd7590ee49da9028d83c0dd63be6b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 11 Oct 2024 21:01:54 +0200 Subject: [PATCH] Create a hello world program in `cargo` --- .gitignore | 4 ---- hello_cargo/Cargo.lock | 7 +++++++ hello_cargo/Cargo.toml | 6 ++++++ hello_cargo/src/main.rs | 3 +++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 hello_cargo/Cargo.lock create mode 100644 hello_cargo/Cargo.toml create mode 100644 hello_cargo/src/main.rs diff --git a/.gitignore b/.gitignore index 3ca43ae..698065d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,6 @@ debug/ target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - # These are backup files generated by rustfmt **/*.rs.bk diff --git a/hello_cargo/Cargo.lock b/hello_cargo/Cargo.lock new file mode 100644 index 0000000..dd1d0bb --- /dev/null +++ b/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/hello_cargo/Cargo.toml b/hello_cargo/Cargo.toml new file mode 100644 index 0000000..0f4a343 --- /dev/null +++ b/hello_cargo/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello_cargo" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/hello_cargo/src/main.rs b/hello_cargo/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/hello_cargo/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}