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
In the Arrays, Vectors, and Slices section the last example warns about the slice syntax.
let a = [0,1,2,3,4];let middle = a.slice(1,4);// A slice of a: just the elements [1,2,3]
This fixes it however I am not sure as to why the & is needed?
let a = [0,1,2,3,4];let middle = &a[1..4];// A slice of a: just the elements [1,2,3]
I would submit a PR but I think some explanation is required and I am not the best person to be explaining this. (Just started looking into rust now that its in v1 alpha)
The text was updated successfully, but these errors were encountered:
In the Arrays, Vectors, and Slices section the last example warns about the slice syntax.
This fixes it however I am not sure as to why the
&
is needed?I would submit a PR but I think some explanation is required and I am not the best person to be explaining this. (Just started looking into rust now that its in v1 alpha)
The text was updated successfully, but these errors were encountered: