about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIan Jackson <ijackson+github@slimy.greenend.org.uk>2020-12-27 00:20:59 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2020-12-27 00:50:46 +0000
commitbeb293d5dfeb17e3dcf1ed348a665f33861691fe (patch)
tree7d1b4a67a374b2a5609a03c1e8f7ee5dae3b0b40
parentf51b68199c80288185f8619c5a2e34cc1cfd85c4 (diff)
downloadrust-beb293d5dfeb17e3dcf1ed348a665f33861691fe.tar.gz
rust-beb293d5dfeb17e3dcf1ed348a665f33861691fe.zip
Drop pointless as_slice call.
Co-authored-by: David Tolnay <dtolnay@gmail.com>
-rw-r--r--library/core/src/slice/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 5f1fe08fe81..1ab7d68805a 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -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 {