Remove useless Clone bound in IndexVec.

This commit is contained in:
Camille GILLOT 2020-05-19 12:04:33 +02:00
parent 3a5d45f68c
commit 736fc96ff3

View File

@ -695,9 +695,7 @@ impl<I: Idx, T> IndexVec<I, T> {
pub fn convert_index_type<Ix: Idx>(self) -> IndexVec<Ix, T> {
IndexVec { raw: self.raw, _marker: PhantomData }
}
}
impl<I: Idx, T: Clone> IndexVec<I, T> {
/// Grows the index vector so that it contains an entry for
/// `elem`; if that is already true, then has no
/// effect. Otherwise, inserts new values as needed by invoking
@ -710,11 +708,6 @@ impl<I: Idx, T: Clone> IndexVec<I, T> {
}
}
#[inline]
pub fn resize(&mut self, new_len: usize, value: T) {
self.raw.resize(new_len, value)
}
#[inline]
pub fn resize_to_elem(&mut self, elem: I, fill_value: impl FnMut() -> T) {
let min_new_len = elem.index() + 1;
@ -722,6 +715,13 @@ impl<I: Idx, T: Clone> IndexVec<I, T> {
}
}
impl<I: Idx, T: Clone> IndexVec<I, T> {
#[inline]
pub fn resize(&mut self, new_len: usize, value: T) {
self.raw.resize(new_len, value)
}
}
impl<I: Idx, T: Ord> IndexVec<I, T> {
#[inline]
pub fn binary_search(&self, value: &T) -> Result<I, I> {