0
0
Rustprogramming~10 mins

Rust toolchain overview - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print "Hello, Rust!" using the Rust toolchain.

Rust
fn main() {
    println!([1]);
}
Drag options to blanks, or click blank then click option'
A"Hello, Rust!"
BHello, Rust!
C'Hello, Rust!'
DHello, Rust
Attempts:
3 left
๐Ÿ’ก Hint
Common Mistakes
Forgetting the double quotes around the string.
Using single quotes which are for characters, not strings.
2fill in blank
medium

Complete the command to build a Rust project using Cargo.

Rust
cargo [1]
Drag options to blanks, or click blank then click option'
Arun
Btest
Cbuild
Dnew
Attempts:
3 left
๐Ÿ’ก Hint
Common Mistakes
Using cargo run when only building is needed.
Using cargo new which creates a new project.
3fill in blank
hard

Fix the error in the Cargo.toml file to specify the Rust edition.

Rust
[package]
name = "my_project"
version = "0.1.0"
edition = [1]
Drag options to blanks, or click blank then click option'
A"2021"
B'2021'
C21
D2021
Attempts:
3 left
๐Ÿ’ก Hint
Common Mistakes
Using a number without quotes causes a parsing error.
Using single quotes instead of double quotes.
4fill in blank
hard

Fill both blanks to create a new Rust project and navigate into its directory.

Rust
cargo [1] my_app
cd [2]
Drag options to blanks, or click blank then click option'
Anew
Bbuild
Cmy_app
Drun
Attempts:
3 left
๐Ÿ’ก Hint
Common Mistakes
Using cargo build instead of cargo new to create a project.
Trying to cd into a folder that does not exist yet.
5fill in blank
hard

Fill all three blanks to run tests, clean build files, and update Rust toolchain.

Rust
cargo [1]
cargo [2]
rustup [3]
Drag options to blanks, or click blank then click option'
Atest
Bclean
Cupdate
Dbuild
Attempts:
3 left
๐Ÿ’ก Hint
Common Mistakes
Confusing cargo clean with cargo build.
Using rustup upgrade which is not a valid command.