@Ambraven@social.mochi.academy
Post #2564786
2026-04-29 20:41 UTC
@terts@mastodon.online Yes, that's it. Thanks.
It's wordy but I don't see better way to write it.
Replies (1)
-
@kornel@mastodon.social 2026-04-30 01:39
@Ambraven@social.mochi.academy `if … { f } else { &A::new() }` used to be impossible, but recent Rust versions actually allow that. It automagically makes a variable in the outer scope of the `if`. It's supported only in certain syntactically-simple cases.