aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-25 06:27:07 +0100
committerGitHub <[email protected]>2019-09-25 06:27:07 +0100
commit6bac2d0a637a6d0b3922a6f8fe05fa32d6d43b15 (patch)
treec3c2af75fa7be376506bf0ffe23fe8cad9c6c402 /crates/ra_hir/src/ty.rs
parentc7420ddaaa76741d1eebe393406b38ba5596e54a (diff)
parent9c45a9e58632966984a79e18aa5221efb65e0ead (diff)
Merge #1904
1904: Remove redundant `clone()` r=matklad a=sinkuu Co-authored-by: Shotaro Yamada <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r--crates/ra_hir/src/ty.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index e6ecbe1ea..fae9c1e22 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -223,7 +223,7 @@ impl Substs {
223 } 223 }
224 224
225 pub fn prefix(&self, n: usize) -> Substs { 225 pub fn prefix(&self, n: usize) -> Substs {
226 Substs(self.0.iter().cloned().take(n).collect::<Vec<_>>().into()) 226 Substs(self.0[..std::cmp::min(self.0.len(), n)].into())
227 } 227 }
228 228
229 pub fn walk(&self, f: &mut impl FnMut(&Ty)) { 229 pub fn walk(&self, f: &mut impl FnMut(&Ty)) {