Rust conditionals: Revision history

From wikinotes

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

9 February 2023

8 February 2023

7 February 2023

6 February 2023

  • curprev 23:2823:28, 6 February 2023Will talk contribs 552 bytes +166 →‎Pattern Matching
  • curprev 23:2723:27, 6 February 2023Will talk contribs 386 bytes +386 Created page with " = Pattern Matching = <blockquote> Like a switch statement,<br> but the compiler ensures the entire valid range of items is checked for.<br> especially useful for enums. <syntaxhighlight lang="rust"> // if num is '1', returns 'a' // if num is >2, returns 'c' let result = match num { 1 => "a", 2 => "b", _ => "c", } </syntaxhighlight> </blockquote><!-- Pattern Matching -->"