From ddabab4f09c67abeab09b9475e3a2b5c691daaee Mon Sep 17 00:00:00 2001 From: Semih <3025014@stud.hs-mannheim.de> Date: Sat, 23 May 2026 17:53:57 +0200 Subject: [PATCH] Paar Ordner erstellt und Hello World und Tooling gemacht --- .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 6 ++++++ src/0-introduction/1-tooling.md | 21 +++++++++++++++++++++ src/0-introduction/2-hello-world.rs | 3 +++ 5 files changed, 38 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 src/0-introduction/1-tooling.md create mode 100644 src/0-introduction/2-hello-world.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..57fcc0b --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "PR3-Rust-SS26" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..efa136b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "PR3-Rust-SS26" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/src/0-introduction/1-tooling.md b/src/0-introduction/1-tooling.md new file mode 100644 index 0000000..73a46ce --- /dev/null +++ b/src/0-introduction/1-tooling.md @@ -0,0 +1,21 @@ +# Rust installieren +- Für Unix basierte Betriebssysteme: + ```bash + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + ``` + +- Für Windows: https://rustup.rs + +# Wichtige Cargo Befehle +| Befehl | Nutzen | +| ------------------------- | ------------------------------------------------- | +| `cargo new ` | Neues Binary-Projekt erstellen | +| `cargo build` | Debug Build | +| `cargon run` | Builden und Runnen | +| `cargo test` | Tests ausführen | +| `cargo init` | Aktuellen Ordner als Cargo-Projekt initialisieren | +| `cargo add` | Abhängigkeiten zu `Cargo.toml` hinzufügen | +| `cargo remove` | Abhängigkeiten aus `Cargo.toml` entfernen | +| `cargo tree` | Abhängigkeitsbaum hinzufügen | +| `cargo fmt` | Code automatisch formattieren | +| `cargo clippy` | Warnungen und Verbesserungsvorschläge | diff --git a/src/0-introduction/2-hello-world.rs b/src/0-introduction/2-hello-world.rs new file mode 100644 index 0000000..47ad8c6 --- /dev/null +++ b/src/0-introduction/2-hello-world.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello World!"); +}