Description
The common container type,
Vec
, a growable vector backed by an array, lives in thevec
module. References to arrays,&[T]
, more commonly called "slices", are built-in types for which theslice
module defines many methods.
I think that in modern Rust parlance [T]
is a slice and &[T]
is a "borrowed slice" (hooray DST). Moreover, if [T; n]
is an "array" then a borrowed slice may be a reference to some contiguous region that isn't backed by an array. This might seem pedantic but I think it's important to be clear that &[T]
may not actually point to an array.
My suggested rewording would be:
Contiguous, unsized regions of memory,
[T]
, commonly called "slices", and their borrowed versions,&[T]
, commonly called "borrowed slices", are built-in types for which the ...