mirror of
https://github.com/nivekuil/rip
synced 2024-11-23 04:03:03 +00:00
Make file handle scope more explicit
This commit is contained in:
parent
bfcff5d03c
commit
c60d7a5235
1 changed files with 7 additions and 6 deletions
13
src/main.rs
13
src/main.rs
|
@ -120,12 +120,13 @@ Send files to the graveyard (/tmp/.graveyard) instead of unlinking them.")
|
|||
fn write_log(source: PathBuf, dest: PathBuf, graveyard: &Path)
|
||||
-> std::io::Result<()> {
|
||||
let histfile = graveyard.join(HISTFILE);
|
||||
let mut f = try!(fs::File::create(histfile));
|
||||
try!(f.write_all(
|
||||
format!("{}\t{}",
|
||||
source.to_str().unwrap(),
|
||||
dest.to_str().unwrap(),
|
||||
).as_bytes()));
|
||||
{
|
||||
let mut f = try!(fs::File::create(histfile));
|
||||
try!(f.write_all(format!("{}\t{}",
|
||||
source.to_str().unwrap(),
|
||||
dest.to_str().unwrap())
|
||||
.as_bytes()));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue