← codetypingtest

Rust typing test

Rust packs a lot of meaning into symbols. Typing it means fn and let mut, :: paths, & and &mut borrows, -> return types, => match arms and a ! on every macro, like println!. Expect it to feel slower than Python or Go at first: there's simply more punctuation on each line.

Start the Rust typing test

What you'll type in Rust

Example: FizzBuzz in Rust

Rust's FizzBuzz matches on a pair of remainders. The _ wildcards and => arrows make it look nothing like the C-style versions.

fn main() {
    for i in 1..=15 {
        match (i % 3, i % 5) {
            (0, 0) => println!("FizzBuzz"),
            (0, _) => println!("Fizz"),
            (_, 0) => println!("Buzz"),
            _ => println!("{}", i),
        }
    }
}

Type this program now

Tips for typing Rust faster

All 20 Rust programs

Every program is real, working Rust. Choose one to start typing it straight away.

Beginner

Intermediate

Advanced

Expert

How the test works

The timer starts on your first key and stops once every character is right. Press Enter for a new line and the indentation is filled in for you. A wrong key shows in red and counts as a mistake; press Backspace to go back and fix it. Your best time for each program is saved in your browser. Read more about how speed and accuracy are calculated, or get tips for typing code faster.

Other languages