This repo contains a Rust workshop. It targets developers wanting to learn Rust and requires knowledge in another programming language. Some parts are focused on comparing Rust with Java.
Knowledge about a programming language (e.g., Java, Python, C, C++, Kotlin, ...)
The folder slides contains a reveal.js presentation with the slides of the workshop.
For the white-mode slides switch to branch white.
- lines starting with
$are terminal commands $ cd slides$ npm install$ npm start- all further instructions are printed to the terminal
- lines starting with
$are terminal commands - Install Rust
- via https://rustup.rs, ...
- ... or the package manager of your distro (e.g., pacman, apt, ...)
- Prepare IDE:
- VSCode: install rust-analyzer plugin
- IntelliJ: install RustRover
- or any editor with LSP support (e.g., Vim, NeoVim, Helix, ...)
- create a hello world project and check if your own setup works
- either with your IDE Wizard, ...
- ... or using the Terminal:
$ cargo new hello_world$ cd hello_world$ cargo run- If everything works correctly
Hello Worldshould be printed to the terminal
- Install custom rustlings version:
$ git clone https://github.com/hnorkowski/rustlings$ cd rustlings$ cargo install --path .- execute the command
$ rustlings --versionrustlings 5.6.1should be printed to the terminal- if the command cannot be found the cargo directory is probably not in your $PATH variable
- you can either add the path (defaults to
~/.cargo/bin) to you $PATH variable, ... - ... or create a symbolic link into a folder that is in your $PATH variable, ...
- e.g.,
$ sudo ln -s ~/.cargo/bin/rustlings /usr/local/bin/
- e.g.,
- ... or start rustlings by using the full path to the binary
- e.g.,
$ ~/.cargo/bin/rustlings --version
- e.g.,
- you can either add the path (defaults to
- now the commands shown on the slides should work
- e.g.,
$ rustlings task1 watch - the command must be executed inside the
rustlings/folder of this repo - if this fails the original version of
rustlingsis used that was installed before - the next task to solve is shown by the command and is not related to the folder structure
- depending on the IDE and Terminal you are using the path to the source code file of the current task can be clicked (some required holding a button like ´Ctrl`) to open it
- e.g.,