quest

Sign in to start training

quest keeps your progress, streaks, and scores tied to your account — so you can pick up on any device.

Synced everywhere. Progress follows you across laptop and phone.
Streaks & stats. See your daily run and every score over time.
Your profile. A name and avatar for the work you do here.

We only use Google to sign you in and sync progress. No posting, no contacts — ever.

Core Intermediate

08  Error handling

Rust models absence and failure in the type system: return an Option for a maybe-missing char, then use ? to propagate parse errors.

Step 1 / 2

Return the first character, or None for "", in first_char.

Hints
  • s.chars().next() gives Option<char>.
08_error_handling.rs
Reset to starterCompiled in a sandbox; hidden checks must pass.
Reveal solution
fn first_char(s: &str) -> Option<char> {
    s.chars().next()
}