News for hackers. Stuff that matters.
Re:Level Up your Rust pattern matching by skeptrune on Monday September 29, 2025 @12:52PM (#45415952)
I needed this. I have some level of intuitive understanding, but this reference will be great whenever I'm not quite sure if something is possible or not.
Re:Level Up your Rust pattern matching by froober on Tuesday September 30, 2025 @08:39PM (#45433028)
I really like rust's pattern matching and it's the feature I miss the most in other languages. However, I feel like its easy to encode too much control flow in one match statement and make a garbled mess. The first example in the article uses all the features (destructuring, @ sigil, inline if, etc.) which I think makes it unreadable.

Overall good article, but those large match statements are difficult to read.

Re:Level Up your Rust pattern matching by Rendello on Tuesday September 30, 2025 @10:12PM (#45433608)
The first pattern-matching language I used was Erlang. I generally like Rust's just as much, but Erlang/Elixir's binary-matching syntax was awesome and is sorely missed:

https://learnyousomeerlang.com/starting-out-for-real#bit-syn...

https://lobste.rs/s/3a9e2a/matching_binary_patterns_with_erl...

Re:Level Up your Rust pattern matching by mrheosuper on Tuesday September 30, 2025 @11:43PM (#45434052)
Suggest for improvement: If you link a Rust playground, at least make it compilable.
Re:Level Up your Rust pattern matching by 1oooqooq on Wednesday October 01, 2025 @07:32AM (#45436532)
being able to read the article without JavaScript is much better.