[core] Minor fixes

parent 91e1a3a4
Pipeline #97667 failed with stages
in 6 minutes and 27 seconds
......@@ -312,6 +312,7 @@ where
/// Won't return the old element back to the caller.
/// Prefer this operation over other method of overriding an element
/// in the storage vector since this is more efficient.
#[inline]
pub fn set(&mut self, index: u32, new_value: T) -> Result<(), IndexOutOfBounds> {
if self.within_bounds(index).is_none() {
return Err(IndexOutOfBounds)
......
......@@ -408,7 +408,7 @@ fn set_works() {
fn set_panics_when_index_oob() {
let mut vec = vec_from_slice(&[b'a']);
let res = vec.set(1, b'x');
assert_eq!(res, Err(gndexOutOfBounds));
assert_eq!(res, Err(IndexOutOfBounds));
}
#[test]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment