Drop pointless as_slice call.

Co-authored-by: David Tolnay <dtolnay@gmail.com>
This commit is contained in:
Ian Jackson 2020-12-27 00:20:59 +00:00 committed by Ian Jackson
parent f51b68199c
commit beb293d5df

View File

@ -1792,7 +1792,7 @@ impl<T> [T] {
{
// This function will need rewriting if and when SlicePattern becomes more sophisticated.
let prefix = prefix.as_slice();
let n = prefix.as_slice().len();
let n = prefix.len();
if n <= self.len() {
let (head, tail) = self.split_at(n);
if head == prefix {