diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/ty.rs | 2 |
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)) { |