~/devtype

Rust Typing Speed Test

Rust's syntax is famously symbol-dense: double colons, ampersands, lifetimes, and the `?` operator all in a single line is normal. Typing Rust fluently means your hands handle `Result<Vec<&'a str>, io::Error>` without your brain leaving the borrow checker.

LV 1
Level 0 / 100 XP
Best 0 WPM
main.js
00 wpm
00%
0s
1
Just start typing or click the code
Esc restart Enter new line, indentation is skipped for you

Surviving Rust's Symbol Density

The path separator `::` is Rust's trademark keystroke — a doubled Shift-semicolon that appears in nearly every import and enum variant. Return type arrows (`->`), fat arrows in match arms (`=>`), and reference operators (`&`, `&mut`) mean your right hand lives on the Shift layer. Add turbofish syntax (`::<>`) and you have four shifted symbols back to back.

Match expressions create a distinctive rhythm: pattern, fat arrow, expression, comma — repeated down the arm list with `Some(x)`, `Ok(val)`, and `_` wildcards. Lifetimes put the apostrophe in identifier position (`'a`), somewhere no prose typist has ever practiced it. These drills use real match blocks and error propagation so the patterns become automatic.

Key Drills for Rust:

  • Double-tap the colon: `::` should be one rapid double-strike, not two hesitant reaches. It's in almost every Rust line.
  • Two arrows, two motions: Keep `->` (return types) and `=>` (match arms) distinct in muscle memory — mixing them is Rust's classic typo.
  • Ampersand first: References prefix everything. Practice `&self`, `&mut`, and `&str` as complete chunks.

Sample Drill: Pattern Matching & Option

Rust match expression to handle Optional values safely.

rust-match · easy
fn get_username(id: u32) -> Option<String> {
    match id {
        1 => Some("alice".to_string()),
        2 => Some("bob".to_string()),
        _ => None,
    }
}

All 15 Rust Drills

Every session picks a random drill from this pool. Use the difficulty filter above to stay on easy warm-ups or jump straight to the hard ones.

  • Pattern Matching & Option easy

    Rust match expression to handle Optional values safely.

  • Filter a Vec easy

    Collect even numbers from a vector with an iterator chain.

  • Format Macro Captures easy

    Build strings with format! using inline captured identifiers.

  • HashMap Entry API easy

    Count word frequencies with the HashMap entry API.

  • If Let with Env Var easy

    Read an optional environment variable using if let.

  • Struct & Impl Block medium

    Defining structures, implementing methods, and referencing self.

  • Implement Display medium

    Implement fmt::Display to print cents as a dollar amount.

  • Serde Derive Struct medium

    Deserialize camelCase JSON into a struct with serde attributes.

  • Enum with Methods medium

    Attach behavior to a Copy enum with an exhaustive match.

  • Parse with filter_map medium

    Parse a comma-separated port list and skip invalid entries.

  • Result Handling & Propagate hard

    Using the question mark operator to propagate Result errors.

  • Error Enum with thiserror hard

    Define a config error type with thiserror and From conversions.

  • Borrowing Tokenizer hard

    A struct with a lifetime that returns slices of its input.

  • Tokio JoinSet Tasks hard

    Spawn async tasks on a JoinSet and handle results as they finish.

  • Shared State with Arc hard

    Increment a counter from many threads with Arc and Mutex.

The Symbols That Slow You Down

The keystrokes below are where Rust typing speed is won or lost. Key positions shown for QWERTY — the pattern transfers to any layout, just on different physical keys.

Symbol Used For Keys How to Drill It
:: Path separator Shift+Semicolon twice Rust's trademark keystroke — in every `use` statement and enum variant. A rapid double-strike, not two reaches.
-> Return arrow - unshifted, then > as Shift+Period Return types on every signature. Keep it distinct from the match-arm arrow in your muscle memory.
=> Match arm arrow = unshifted, then > as Shift+Period Ends every match arm. The classic Rust typo is swapping this with `->` — train them as different gestures.
& Borrow Shift+7 `&self`, `&str`, `&mut` — references prefix half of Rust. Type `&mut` as one chunk.
'a Lifetime Apostrophe unshifted, then letter The apostrophe appears in identifier position — somewhere prose typists have never practiced it.
? Error propagation Shift+Slash Sits at expression ends (`f()?`), often in chains. A shifted question mark that must cost nothing.

Common Rust Typing Mistakes

  • ✗ Swapping `->` and `=>` — the number one Rust typing error. Drill match blocks and signatures in separate passes.
  • ✗ Hesitating on `::` — if you're spelling it as two deliberate colons, it's slowing every import line.
  • ✗ Missing the `?` at the end of chained calls; it's small, shifted, and easy to drop at speed.

What's a Good Rust Typing Speed?

Rust is the slowest mainstream language to type: 20–35 WPM is normal working speed on symbol-dense code, and 40 WPM with 95%+ accuracy is genuinely fast. Lifetimes and turbofish (`Vec::<u8>`) separate experienced Rust typists from everyone else.