Since "deref" can be implemented differently for each type, you cannot know what it does in general, but in this case '*Vec<T>' turns it into a '[T]'.
If you compile in release mode, all of the following implementations of 'clone' will emit identical assembly:
<[T]>::to_vec(&**self) <[T]>::to_vec(&self[..]) <[T]>::to_vec(self.as_slice()) self.as_slice().to_vec()
Since "deref" can be implemented differently for each type, you cannot know what it does in general, but in this case '*Vec<T>' turns it into a '[T]'.
If you compile in release mode, all of the following implementations of 'clone' will emit identical assembly:
The stdlib picked the coolest looking one. Can't fault them for that.