You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The common container type, Vec, a growable vector backed by an
array, lives in the vec module. References to
arrays, &[T], more commonly called "slices", are built-in types
for which the slice 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 ...
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: