Skip to content

Commit 246d153

Browse files
chore: apply clippy lints
Signed-off-by: Florian Hartung <florian.hartung@dlr.de>
1 parent c0d52b5 commit 246d153

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/memory_as_slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn simple_byte_writes() {
1111

1212
store
1313
.mem_access_mut_slice(mem, |mem_as_slice| {
14-
for (n, x) in mem_as_slice.into_iter().enumerate() {
14+
for (n, x) in mem_as_slice.iter_mut().enumerate() {
1515
*x = u8::try_from(n % 256).expect("this to never be larger than 255");
1616
}
1717
})
@@ -38,7 +38,7 @@ fn interpret_as_str() {
3838
// Read the string again and check if it is equal to the original one
3939
store
4040
.mem_access_mut_slice(mem, |mem_as_slice| {
41-
let bytes = &mem_as_slice[0..STR_TO_WRITE.as_bytes().len()];
41+
let bytes = &mem_as_slice[0..STR_TO_WRITE.len()];
4242
let as_str = std::str::from_utf8(bytes).unwrap();
4343
assert_eq!(as_str, STR_TO_WRITE);
4444
})

0 commit comments

Comments
 (0)