Get the latest tech news

Rust's Most Subtle Syntax


'What?' - Richard Nixon

“expr equals 4” isn’t an irrefutable match, and you aren’t handling the case where it doesn’t. Realistically, the only reason this can be confusing is that you’re allowed to write let UPPERCASE, and const lowercase. If creating a variable that started with a capital letter was a lint error, no confusion could happen; you could never accidentally bind something when trying to match an enum variant or constant.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Rust

Rust

Photo of Subtle Syntax

Subtle Syntax

Related news:

News photo

Bionic reading converter for ePub in Rust

News photo

Crux, a Precise Verifier for Rust and Other Languages

News photo

Rust and C++ with Steve Klabnik and Herb Sutter [audio]