diff options
| author | jakka <jakkadoujin@gmail.com> | 2025-06-10 19:55:53 +0300 |
|---|---|---|
| committer | jakka <jakkadoujin@gmail.com> | 2025-06-10 19:55:53 +0300 |
| commit | a00b57823ee918989ffeae2b93ec778aefc93cb2 (patch) | |
| tree | 19644e6f0085568239ac3523ce79d0c56e6dc749 | |
| parent | 4ecfc50de96a07de00757a625546b9fc43e9c2c3 (diff) | |
continued working
| -rw-r--r-- | Cargo.lock | 12 | ||||
| -rw-r--r-- | src/db.rs | 1 | ||||
| -rw-r--r-- | src/flac.rs | 4 | ||||
| -rw-r--r-- | src/main.rs | 3 |
4 files changed, 11 insertions, 9 deletions
@@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.23.0" +version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" [[package]] name = "byteorder" @@ -43,9 +43,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.2.25" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0fc897dc1e865cc67c0e05a836d9d3f1df3cbe442aa4a9473b18e12624a4951" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "shlex", ] @@ -212,9 +212,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "symphonia" 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)] |
