Hi !
Quick post today on how to install rust in a Raspberry Pi, and later create a hello world test app.
Install Rust
I’m starting this with the latest updates for Raspberry Pi OS installed.
The command to install rust is this one:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Check the Rust Lang documentation for more details.
Let’s choose the default installation, this may take a couple of minutes.
And now, we can check the rust and cargo versions with the following commands
rustc --version
cargo --version
Hello World project
Now let’s use cargo to create a new project. I’ll name it “DemoBlogPost”. In the following image, we can check the default contents of the project
- cargo.toml
- src/main.rs
Time to edit the main.rs file. I’m not a VIM user, so it’s nano time.
And now, time to run the project !
Super fun and literally a great way to use a device like a raspberry pi to learn Rust !
Happy coding!
Greetings
El Bruno
More posts in my blog ElBruno.com.