Did you know that in Rust, 'let _ = ...' and 'let _unused = ...' are NOT the same thing?
I didn't until today!

https://gaultier.github.io/blog/rust_underscore_vars.html

#rust

In Rust, `let _ = ...` and `let _unused = ...` are not the same

@pg Interesting! This lead me into a short rabbithole. This is what I found:

- let _ = ... is pattern matching (https://doc.rust-lang.org/stable/reference/patterns.html#grammar-WildcardPattern states: "Unlike identifier patterns, it does not copy, move or borrow the value it matches")
- let _unused = ... assignes a variable (which is only unused by convention)

If you follow the reference carefully, it turns out that _ is not a valid identifier! It is actually a keyword (https://doc.rust-lang.org/stable/reference/keywords.html#r-lex.keywords.strict)

TIL

Patterns - The Rust Reference