mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 05:08:19 +00:00
Running clippy again found two more improvements.
Missed a manual memcpy loop in engine-object-file. CompilerType::enabled() is a Vec<>, so just use is_empty() instead of trying to generically determine whether an Iter is empty.
This commit is contained in:
@@ -80,7 +80,7 @@ impl Run {
|
||||
format!(
|
||||
"failed to run `{}`{}",
|
||||
self.path.display(),
|
||||
if CompilerType::enabled().iter().next().is_none() {
|
||||
if CompilerType::enabled().is_empty() {
|
||||
" (no compilers enabled)"
|
||||
} else {
|
||||
""
|
||||
|
||||
@@ -295,9 +295,6 @@ impl ObjectFileArtifact {
|
||||
let mut byte_buffer = [0u8; WORD_SIZE];
|
||||
|
||||
let mut cur_offset = data_len + 10;
|
||||
for i in 0..WORD_SIZE {
|
||||
byte_buffer[i] = bytes[cur_offset + i];
|
||||
}
|
||||
byte_buffer[0..WORD_SIZE].clone_from_slice(&bytes[cur_offset..(cur_offset + WORD_SIZE)]);
|
||||
cur_offset += WORD_SIZE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user