Make Range implementation safe

This commit is contained in:
Jacob Pratt
2021-04-01 05:06:28 -04:00
parent 641c8cd875
commit a875876027
3 changed files with 24 additions and 31 deletions

View File

@@ -184,7 +184,7 @@ macro_rules! newtype_index {
}
}
unsafe impl ::std::iter::Step for $type {
impl ::std::iter::Step for $type {
#[inline]
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
<usize as ::std::iter::Step>::steps_between(