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
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner