Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Match

Design

Invocation

(find name)

match variable { <arms> }
match foo.method() { <arms> }

Postfix

let variable = Some(42);

variable.match { <arms> }
foo.method().match { <arms> }

foo.method().match { <arms> }.continue()

Arms

Small arrow syntax (languages)

<match> {
  123 -> {}
  else -> {}
}

Rust large arrow syntax

<match> {
  123 => {}
  _ => {}
}

no arrows

<match> {
  123 { 456 }
  _ {
    // -snip-
  }
}