Unverified Commit ea08ae09 authored by Michael Müller's avatar Michael Müller Committed by GitHub

Apply suggestions from code review

Co-authored-by: default avatarHero Bird <robin.freyler@gmail.com>
parent c92cdd70
Pipeline #97671 passed with stages
in 8 minutes and 53 seconds
...@@ -405,7 +405,7 @@ fn set_works() { ...@@ -405,7 +405,7 @@ fn set_works() {
} }
#[test] #[test]
fn set_panics_when_index_oob() { fn set_fails_when_index_oob() {
let mut vec = vec_from_slice(&[b'a']); let mut vec = vec_from_slice(&[b'a']);
let res = vec.set(1, b'x'); let res = vec.set(1, b'x');
assert_eq!(res, Err(IndexOutOfBounds)); assert_eq!(res, Err(IndexOutOfBounds));
...@@ -415,12 +415,12 @@ fn set_panics_when_index_oob() { ...@@ -415,12 +415,12 @@ fn set_panics_when_index_oob() {
fn clear_works_on_filled_vec() { fn clear_works_on_filled_vec() {
let mut vec = vec_from_slice(&[b'a', b'b', b'c', b'd']); let mut vec = vec_from_slice(&[b'a', b'b', b'c', b'd']);
vec.clear(); vec.clear();
assert_eq!(vec.len(), 0); assert!(vec.is_empty());
} }
#[test] #[test]
fn clear_works_on_empty_vec() { fn clear_works_on_empty_vec() {
let mut vec = vec_from_slice(&[]); let mut vec = vec_from_slice(&[]);
vec.clear(); vec.clear();
assert_eq!(vec.len(), 0); assert!(vec.is_empty());
} }
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