Problem scenario
You want to write a basic program in Rust to know you have it installed correctly. What do you do?
Solution
- Install Rust. If you need assistance, try this command:
sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2. Create a file called contint.rs with the following four lines:
// We recommend calling this contint.rs
fn main() {
println!("Hello World!");
}
- Compile it with this command:
rustc contint.rs
- Run the bytecode by using this command:
./contint