Slicing a Slice

We’ve been using the term slice for a while now. But we haven’t talked about why they’re called slices. It turns out there’s a good reason; you can slice up a slice! Oftentimes, we want to look at a smaller piece of a collection. And Rust has slice syntax to allow talking about these smaller pieces.

It’s easiest to see this in action:

Get hands-on with 1200+ tech skills courses.