Removed unneeded conversion to a slice.

Vec<T> can index now so its a useless conversion.
auto merge of #19134 : sinistersnare/rust/patch-2, r=alexcrichton

Vec<T> can index now so its a useless conversion.