Fix warnings in preparation for Rust 1.54.0
This CL fixes several new warnings generated by rustc 1.54.0.
Bug: 194812675
Test: m rust
Change-Id: I104aaf07897db4df89dd1598969dd74221bfdd0b
diff --git a/authfs/src/fsverity/editor.rs b/authfs/src/fsverity/editor.rs
index 8468cc9..86ff4d6 100644
--- a/authfs/src/fsverity/editor.rs
+++ b/authfs/src/fsverity/editor.rs
@@ -206,7 +206,7 @@
// (original) integrity for the file. To matches what write(2) describes for an error
// case (though it's about direct I/O), "Partial data may be written ... should be
// considered inconsistent", an error below is propagated.
- self.file.write_all_at(&source, output_offset)?;
+ self.file.write_all_at(source, output_offset)?;
// Update the hash only after the write succeeds. Note that this only attempts to keep
// the tree consistent to what has been written regardless the actual state beyond the
@@ -290,7 +290,7 @@
if end > self.data.borrow().len() {
self.data.borrow_mut().resize(end, 0);
}
- self.data.borrow_mut().as_mut_slice()[begin..end].copy_from_slice(&buf);
+ self.data.borrow_mut().as_mut_slice()[begin..end].copy_from_slice(buf);
Ok(buf.len())
}
@@ -318,7 +318,7 @@
format!("read_chunk out of bound: index {}", chunk_index),
)
})?;
- buf[..chunk.len()].copy_from_slice(&chunk);
+ buf[..chunk.len()].copy_from_slice(chunk);
Ok(chunk.len())
}
}