src/backup/archive_index.rs: use close() instead of flush()

Also pass a reference to the encoder.
This commit is contained in:
Dietmar Maurer
2019-01-02 11:02:56 +01:00
parent 94a882e900
commit 5e7a09be0d
5 changed files with 69 additions and 61 deletions

View File

@ -14,7 +14,7 @@ fn run_test(dir_name: &str) -> Result<(), Error> {
.status()
.expect("failed to execute casync");
let writer = std::fs::OpenOptions::new()
let mut writer = std::fs::OpenOptions::new()
.create(true)
.write(true)
.truncate(true)
@ -26,7 +26,7 @@ fn run_test(dir_name: &str) -> Result<(), Error> {
let path = std::path::PathBuf::from(dir_name);
CaTarEncoder::encode(path, &mut dir, writer)?;
CaTarEncoder::encode(path, &mut dir, &mut writer)?;
Command::new("cmp")
.arg("--verbose")