Skip to content

Commit 3603d31

Browse files
committed
Remove useless Clone bound in IndexVec.
1 parent dcd470f commit 3603d31

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/librustc_index/vec.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,7 @@ impl<I: Idx, T> IndexVec<I, T> {
671671
pub fn convert_index_type<Ix: Idx>(self) -> IndexVec<Ix, T> {
672672
IndexVec { raw: self.raw, _marker: PhantomData }
673673
}
674-
}
675674

676-
impl<I: Idx, T: Clone> IndexVec<I, T> {
677675
/// Grows the index vector so that it contains an entry for
678676
/// `elem`; if that is already true, then has no
679677
/// effect. Otherwise, inserts new values as needed by invoking
@@ -686,18 +684,20 @@ impl<I: Idx, T: Clone> IndexVec<I, T> {
686684
}
687685
}
688686

689-
#[inline]
690-
pub fn resize(&mut self, new_len: usize, value: T) {
691-
self.raw.resize(new_len, value)
692-
}
693-
694687
#[inline]
695688
pub fn resize_to_elem(&mut self, elem: I, fill_value: impl FnMut() -> T) {
696689
let min_new_len = elem.index() + 1;
697690
self.raw.resize_with(min_new_len, fill_value);
698691
}
699692
}
700693

694+
impl<I: Idx, T: Clone> IndexVec<I, T> {
695+
#[inline]
696+
pub fn resize(&mut self, new_len: usize, value: T) {
697+
self.raw.resize(new_len, value)
698+
}
699+
}
700+
701701
impl<I: Idx, T: Ord> IndexVec<I, T> {
702702
#[inline]
703703
pub fn binary_search(&self, value: &T) -> Result<I, I> {

0 commit comments

Comments
 (0)