authfs: fix lints with rustc 1.51.0
Bug: 184277852
Test: m with rustc 1.51.0
Change-Id: I908bb4c3592e8f824cb9451806e6f8695c8110f6
diff --git a/authfs/src/fsverity/builder.rs b/authfs/src/fsverity/builder.rs
index 94b9718..dd1bd04 100644
--- a/authfs/src/fsverity/builder.rs
+++ b/authfs/src/fsverity/builder.rs
@@ -39,10 +39,7 @@
.chunks(HASH_PER_PAGE)
.map(|chunk| {
let padding_bytes = (HASH_PER_PAGE - chunk.len()) * HASH_SIZE;
- Ok(Sha256Hasher::new()?
- .update_from(chunk)?
- .update(&vec![0u8; padding_bytes])?
- .finalize()?)
+ Sha256Hasher::new()?.update_from(chunk)?.update(&vec![0u8; padding_bytes])?.finalize()
})
.collect()
}
diff --git a/authfs/src/main.rs b/authfs/src/main.rs
index 0db73e9..60f603f 100644
--- a/authfs/src/main.rs
+++ b/authfs/src/main.rs
@@ -31,7 +31,7 @@
use std::collections::BTreeMap;
use std::fs::File;
use std::io::Read;
-use std::path::PathBuf;
+use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex};
use structopt::StructOpt;
@@ -225,9 +225,9 @@
}
fn new_config_local_ro_file(
- protected_file: &PathBuf,
- merkle_tree_dump: &PathBuf,
- signature: &PathBuf,
+ protected_file: &Path,
+ merkle_tree_dump: &Path,
+ signature: &Path,
) -> Result<FileConfig> {
let file = File::open(&protected_file)?;
let file_size = file.metadata()?.len();
@@ -241,7 +241,7 @@
Ok(FileConfig::LocalVerifiedReadonlyFile { reader, file_size })
}
-fn new_config_local_ro_file_unverified(file_path: &PathBuf) -> Result<FileConfig> {
+fn new_config_local_ro_file_unverified(file_path: &Path) -> Result<FileConfig> {
let reader = LocalFileReader::new(File::open(file_path)?)?;
let file_size = reader.len();
Ok(FileConfig::LocalUnverifiedReadonlyFile { reader, file_size })