src/backup/chunk_store.rs: coding style fixes
This commit is contained in:
parent
e4c2fbf170
commit
a24e3993e0
@ -177,8 +177,14 @@ impl ChunkStore {
|
|||||||
|
|
||||||
let (chunk_path, digest_str) = self.chunk_path(digest);
|
let (chunk_path, digest_str) = self.chunk_path(digest);
|
||||||
let mut file = std::fs::File::open(&chunk_path)
|
let mut file = std::fs::File::open(&chunk_path)
|
||||||
.map_err(|err| format_err!(
|
.map_err(|err| {
|
||||||
"store '{}', unable to read chunk '{}' - {}", self.name, digest_str, err))?;
|
format_err!(
|
||||||
|
"store '{}', unable to read chunk '{}' - {}",
|
||||||
|
self.name,
|
||||||
|
digest_str,
|
||||||
|
err,
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
DataChunk::load(&mut file, *digest)
|
DataChunk::load(&mut file, *digest)
|
||||||
}
|
}
|
||||||
@ -193,12 +199,15 @@ impl ChunkStore {
|
|||||||
use nix::fcntl::OFlag;
|
use nix::fcntl::OFlag;
|
||||||
use nix::sys::stat::Mode;
|
use nix::sys::stat::Mode;
|
||||||
|
|
||||||
let base_handle = match Dir::open(
|
let base_handle = Dir::open(&self.chunk_dir, OFlag::O_RDONLY, Mode::empty())
|
||||||
&self.chunk_dir, OFlag::O_RDONLY, Mode::empty()) {
|
.map_err(|err| {
|
||||||
Ok(h) => h,
|
format_err!(
|
||||||
Err(err) => bail!("unable to open store '{}' chunk dir {:?} - {}",
|
"unable to open store '{}' chunk dir {:?} - {}",
|
||||||
self.name, self.chunk_dir, err),
|
self.name,
|
||||||
};
|
self.chunk_dir,
|
||||||
|
err,
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
let mut done = false;
|
let mut done = false;
|
||||||
let mut inner: Option<tools::fs::ReadDir> = None;
|
let mut inner: Option<tools::fs::ReadDir> = None;
|
||||||
|
Loading…
Reference in New Issue
Block a user