3min chapter

 Rustacean Station  cover image

What's New in Rust 1.40

Rustacean Station

CHAPTER

Using Patterns in a Pattern Context?

The most common case for this is a, you have astruct of some type, and you wan to look at just one field of that struct a. And so it ends up being a pattern that's not just a direct field access. In the past, as a library author, you sort of just had the choice of either i make this field public and then let people access it,. But if i add a field later, anyone who matches on it, that pattern is no longer going to compile because it doesn't mention this new field that i've added.

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