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:
Nick Lewycky
2020-10-08 21:08:12 -07:00
parent a01d3d3d70
commit fbad7ad25c
2 changed files with 1 additions and 4 deletions

View File

@@ -80,7 +80,7 @@ impl Run {
format!( format!(
"failed to run `{}`{}", "failed to run `{}`{}",
self.path.display(), self.path.display(),
if CompilerType::enabled().iter().next().is_none() { if CompilerType::enabled().is_empty() {
" (no compilers enabled)" " (no compilers enabled)"
} else { } else {
"" ""

View File

@@ -295,9 +295,6 @@ impl ObjectFileArtifact {
let mut byte_buffer = [0u8; WORD_SIZE]; let mut byte_buffer = [0u8; WORD_SIZE];
let mut cur_offset = data_len + 10; 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)]); byte_buffer[0..WORD_SIZE].clone_from_slice(&bytes[cur_offset..(cur_offset + WORD_SIZE)]);
cur_offset += WORD_SIZE; cur_offset += WORD_SIZE;