I'm trying to add some helpers to tabled
, and there is something about Rust and generics that I don't seem to be getting. At all..
/// Row denotes a set of cells on given rows on a `Grid`
pub struct Row<R: RangeBounds<usize>>(pub R);
impl<R: RangeBounds<usize>> Row<R> {
pub fn single(row: usize) -> Self {
Self(row..=row)
}
}
And the error is
mismatched types
expected type parameter `R`
found struct `std::ops::RangeInclusive<usize>`