Skip to content

Commit

Permalink
Remove the unspecified check about .get(exhausted_range_inclusive)
Browse files Browse the repository at this point in the history
`RangeInclusive::is_empty` (rust 1.47+) is in conflict with our MSRV (1.43.1) so we can't use it yet.
The unspecified behavior is documented in `Itertools::get` so we simply remove this.
  • Loading branch information
Philippe-Cholet committed Mar 7, 2024
1 parent 7ca676c commit 8831e7d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/iter_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ where
type Output = Take<Skip<I>>;

fn index(self, iter: I) -> Self::Output {
debug_assert!(!self.is_empty(), "The given `RangeInclusive` is exhausted. The result of indexing with an exhausted `RangeInclusive` is unspecified.");
iter.skip(*self.start())
.take((1 + *self.end()).saturating_sub(*self.start()))
}
Expand Down

0 comments on commit 8831e7d

Please sign in to comment.