cleanup
This commit is contained in:
@@ -6,6 +6,7 @@ where
|
||||
RangeInclusive<T>: Iterator<Item = T> + DoubleEndedIterator,
|
||||
Rev<RangeInclusive<T>>: Iterator<Item = T>,
|
||||
{
|
||||
// check that x is in range
|
||||
if min > x || x > max {
|
||||
return Vec::new();
|
||||
}
|
||||
@@ -35,6 +36,9 @@ mod test {
|
||||
assert_eq!(split_from(0, 6, 6), vec![vec![5, 4, 3, 2, 1, 0]]);
|
||||
|
||||
// test out-of-bounds and also generics
|
||||
assert_eq!(split_from::<i16>(-1, 4, 10), Vec::<Vec<i16>>::new());
|
||||
assert_eq!(
|
||||
split_from::<i16>(-1i16, 4i16, 10i16),
|
||||
Vec::<Vec<i16>>::new()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user