logoalt Hacker News

zaphirplanelast Friday at 8:34 PM1 replyview on HN

So many options why oh why. let run with also apply


Replies

jeroenhdyesterday at 12:42 AM

Each does different things, and Rust also has plenty of them. and_then(), or(), or_else(), then(), the list goes on. Kotlin just implements them more widely.

Actually, Kotlin's with() and apply() are more powerful than what Rust can provide. Then again, Rust isn't designed with OO in mind, so you probably shouldn't use those patterns in Rust anyway.

show 1 reply