3min chapter

 Rustacean Station  cover image

What's New in Rust 1.40

Rustacean Station

CHAPTER

Is the Commododot Pattern a Trait Off?

The comma datat pattern lets you mark your type as something where the compiler is going to enforce that people who match on your type must use the commododot pattern. And so this means that you can now add more variants and know that you want, you won't make users code not compile just because you added a field or variant. Some users really enjoy the idea of o i've covered every single case, and nothing can go wrong. They don't need a default case or like, a fall through back up case. I think that's definitely true both for structs and for enoms, but perhaps especially for enom where this sort of the compilation checking that you're matching exhaust

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode