little_ferris@programming.dev to Rust@programming.devEnglish · edit-220 days agoWhat are some mind blowing Rust tricks?message-squaremessage-square52fedilinkarrow-up167arrow-down12file-text
arrow-up165arrow-down1message-squareWhat are some mind blowing Rust tricks?little_ferris@programming.dev to Rust@programming.devEnglish · edit-220 days agomessage-square52fedilinkfile-text
If we were to create a Rust version of this page for Haskell, what cool programming techniques would you add to it?
minus-squaresilasmariner@programming.devlinkfedilinkarrow-up3·20 days agoType guards, then :) very cool, much compiler power, love it
minus-squarelittle_ferris@programming.devOPlinkfedilinkEnglisharrow-up2·20 days agoDo you mean RAII guards https://rust-unofficial.github.io/patterns/patterns/behavioural/RAII.html Or match guards? https://doc.rust-lang.org/rust-by-example/flow_control/match/guard.html
minus-squarenaonintendois@programming.devlinkfedilinkarrow-up6·20 days agoMaybe they’re referring to “where clauses”?
minus-squaresilasmariner@programming.devlinkfedilinkarrow-up2·20 days agoIndeed I am. Forgot the name, lol, not worked with rust for a few months 😅
Type guards, then :) very cool, much compiler power, love it
Do you mean RAII guards
https://rust-unofficial.github.io/patterns/patterns/behavioural/RAII.html
Or match guards?
https://doc.rust-lang.org/rust-by-example/flow_control/match/guard.html
Maybe they’re referring to “where clauses”?
Indeed I am. Forgot the name, lol, not worked with rust for a few months 😅