Skip to content

Commit d394f14

Browse files
committed
Change Index and IndexMut implements for better errors
1 parent bab82ae commit d394f14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/arrayvec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ where
10171017
/// # Panics
10181018
/// Panics if index is out of bounds.
10191019
fn index(&self, index: I) -> &Self::Output {
1020-
self.get(index).unwrap()
1020+
self.deref().index(index)
10211021
}
10221022
}
10231023

@@ -1034,7 +1034,7 @@ where
10341034
/// # Panics
10351035
/// Panics if index is out of bounds.
10361036
fn index_mut(&mut self, index: I) -> &mut Self::Output {
1037-
self.get_mut(index).unwrap()
1037+
self.deref_mut().index_mut(index)
10381038
}
10391039
}
10401040

0 commit comments

Comments
 (0)