logoalt Hacker News

atq2119last Friday at 10:09 PM1 replyview on HN

Not mentioned in the article but kinda neat: you can label such a block and break out of it, too! The break takes an argument that becomes the value of the block that is broken out of.


Replies

the__alchemistlast Friday at 10:39 PM

I just learned this one, and am gradually starting to use it! It applies for loops too. I saw it in ChatGPT code, and had to stop and look it up. Rust is a big language, for worse and for better.

show 2 replies