summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/db.rs1
-rw-r--r--src/flac.rs4
-rw-r--r--src/main.rs3
3 files changed, 5 insertions, 3 deletions
diff --git a/src/db.rs b/src/db.rs
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/db.rs
@@ -0,0 +1 @@
+
diff --git a/src/flac.rs b/src/flac.rs
index af95a7a..febdd3d 100644
--- a/src/flac.rs
+++ b/src/flac.rs
@@ -171,7 +171,9 @@ pub fn encode_file(file: &std::path::Path) -> Result<()> {
}
}
- output.write_to_path(tempname)?;
+ output.write_to_path(&tempname)?;
+
+ std::fs::rename(&tempname, file)?;
Ok(())
}
diff --git a/src/main.rs b/src/main.rs
index 5e4657e..07b1c89 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,11 +1,10 @@
+mod db;
mod flac;
fn main() {
- let start = std::time::Instant::now();
if let Err(err) = flac::encode_file(std::path::Path::new("16bit.flac")) {
println!("{}", err)
};
- println!("{}", start.elapsed().as_secs())
}
#[cfg(test)]