Post #2564769
2026-04-29 15:12 UTC
@Ambraven@social.mochi.academy
Something like:
`foo.map(|f| f.clone()).unwrap_or_else(||A::new())`
Replies (1)
-
@pauldoo@mastodon.scot 2026-04-29 15:24
@emily_s@mastodon.me.uk @Ambraven@social.mochi.academy there’s `.cloned()` on `Option` which will make this slightly shorter still.