Skip to content

Commit

Permalink
Remove duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
BroGamer4256 committed Jun 8, 2024
1 parent f095ecc commit f92173b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,8 @@ impl Farc {
}

pub fn write_file<P: AsRef<Path>>(&self, path: P, compress: bool) -> Result<()> {
if self
.entries
.iter()
.find(|(_, data)| data.pending_writes())
.is_some()
{
return Err(FarcError::PendingWrites);
}
let mut file = File::create(path)?;
let parser = self.write_parser(compress)?;
let mut file = File::create(path)?;
file.write(&parser.to_buf_const().unwrap())?;
Ok(())
}
Expand Down

0 comments on commit f92173b

Please sign in to comment.