We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0d52b5 commit 246d153Copy full SHA for 246d153
tests/memory_as_slice.rs
@@ -11,7 +11,7 @@ fn simple_byte_writes() {
11
12
store
13
.mem_access_mut_slice(mem, |mem_as_slice| {
14
- for (n, x) in mem_as_slice.into_iter().enumerate() {
+ for (n, x) in mem_as_slice.iter_mut().enumerate() {
15
*x = u8::try_from(n % 256).expect("this to never be larger than 255");
16
}
17
})
@@ -38,7 +38,7 @@ fn interpret_as_str() {
38
// Read the string again and check if it is equal to the original one
39
40
41
- let bytes = &mem_as_slice[0..STR_TO_WRITE.as_bytes().len()];
+ let bytes = &mem_as_slice[0..STR_TO_WRITE.len()];
42
let as_str = std::str::from_utf8(bytes).unwrap();
43
assert_eq!(as_str, STR_TO_WRITE);
44
0 commit comments