From 290db5ce103531d4a9abd3a269b01d6c1d9fafcf Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 11 Oct 2025 16:32:13 -0400 Subject: [PATCH 1/5] Wanring fix --- src/song.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/song.rs b/src/song.rs index 183d08b..7ebc487 100644 --- a/src/song.rs +++ b/src/song.rs @@ -113,7 +113,7 @@ impl Song { Ok(song_path) => { let p = std::path::Path::new(&song_path); if p.exists() { - match std::fs::remove_file(&p) { + match std::fs::remove_file(p) { Ok(_) => Ok(()), Err(err) => Err(err), } -- 2.43.0 From d5e0f7c64e1610968e8218fd84a67e07f27faf82 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 11 Oct 2025 18:09:50 -0400 Subject: [PATCH 2/5] Added method to remove file from the filesystem --- src/coverart.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/coverart.rs b/src/coverart.rs index 5444a3e..6b7a782 100644 --- a/src/coverart.rs +++ b/src/coverart.rs @@ -39,7 +39,18 @@ impl CoverArt { } } - // TODO: Add method to remove from filesystem + /// Removes the coverart from the filesystem + pub fn remove_from_filesystem(&self) -> Result<(), std::io::Error> { + let p = std::path::Path::new(&self.path); + if p.exists() { + match std::fs::remove_file(p) { + Ok(_) => Ok(()), + Err(err) => Err(err), + } + } else { + Err(std::io::Error::other("Cannot delete file that does not exist")) + } + } } pub mod io { -- 2.43.0 From 17e46f04f7cee18fc1426d9485f32ecf1e237539 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 11 Oct 2025 18:10:11 -0400 Subject: [PATCH 3/5] Made some changes to the method --- src/song.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/song.rs b/src/song.rs index 7ebc487..99b05d6 100644 --- a/src/song.rs +++ b/src/song.rs @@ -118,7 +118,7 @@ impl Song { Err(err) => Err(err), } } else { - Ok(()) + Err(std::io::Error::other("Cannot delete file that does not exist")) } } Err(err) => Err(err), -- 2.43.0 From 1000d52556325864fe04e29bbdbfacd4c5a6175a Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 11 Oct 2025 18:10:28 -0400 Subject: [PATCH 4/5] Code formatting --- src/coverart.rs | 4 +++- src/song.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/coverart.rs b/src/coverart.rs index 6b7a782..06ac2fc 100644 --- a/src/coverart.rs +++ b/src/coverart.rs @@ -48,7 +48,9 @@ impl CoverArt { Err(err) => Err(err), } } else { - Err(std::io::Error::other("Cannot delete file that does not exist")) + Err(std::io::Error::other( + "Cannot delete file that does not exist", + )) } } } diff --git a/src/song.rs b/src/song.rs index 99b05d6..230b516 100644 --- a/src/song.rs +++ b/src/song.rs @@ -118,7 +118,9 @@ impl Song { Err(err) => Err(err), } } else { - Err(std::io::Error::other("Cannot delete file that does not exist")) + Err(std::io::Error::other( + "Cannot delete file that does not exist", + )) } } Err(err) => Err(err), -- 2.43.0 From 48cb380d0578f59f76f2c55d8bf15a1f04f0093f Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 11 Oct 2025 18:11:29 -0400 Subject: [PATCH 5/5] Version bump --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b72049e..a044124 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -142,7 +142,7 @@ checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "icarus_models" -version = "0.6.5" +version = "0.6.6" dependencies = [ "josekit", "rand", diff --git a/Cargo.toml b/Cargo.toml index a1b9ebd..5778e36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_models" -version = "0.6.5" +version = "0.6.6" edition = "2024" rust-version = "1.88" description = "models used for the icarus project" -- 2.43.0