Level Up your Rust pattern matching

(blog.cuongle.dev)

39 points | by cuongleqq 3 days ago ago

6 comments

  • froober a day ago ago

    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.

  • skeptrune 3 days ago ago

    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.

  • mrheosuper a day ago ago

    Suggest for improvement: If you link a Rust playground, at least make it compilable.

    • 1oooqooq 18 hours ago ago

      being able to read the article without JavaScript is much better.

  • 3 days ago ago
    [deleted]