From 84c0cda0728f44a30c49281bea733b521c32f37d Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 11 Oct 2025 16:00:05 -0400 Subject: [PATCH 1/3] Moved function --- src/coverart.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/coverart.rs b/src/coverart.rs index edb5de4..15b21fa 100644 --- a/src/coverart.rs +++ b/src/coverart.rs @@ -1,5 +1,3 @@ -use std::io::Read; - use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Default, Deserialize, Serialize, utoipa::ToSchema)] @@ -28,8 +26,17 @@ pub mod init { } impl CoverArt { - pub fn to_data(&self) -> Result, std::io::Error> { - let path: &String = &self.path; + + // TODO: Add method to save to filesystem + // TODO: Add method to remove from filesystem +} + +pub mod io { + use std::io::Read; + + /// Gets the raw data of the cover art + pub fn to_data(coverart: &super::CoverArt) -> Result, std::io::Error> { + let path: &String = &coverart.path; let mut file = std::fs::File::open(path)?; let mut buffer = Vec::new(); match file.read_to_end(&mut buffer) { @@ -37,9 +44,6 @@ impl CoverArt { Err(err) => Err(err), } } - - // TODO: Add method to save to filesystem - // TODO: Add method to remove from filesystem } #[cfg(test)] -- 2.43.0 From f0c12094bf1eb1f2f6855da03683630c714993e0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 11 Oct 2025 16:03:33 -0400 Subject: [PATCH 2/3] Code formatting --- src/coverart.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coverart.rs b/src/coverart.rs index 15b21fa..d6741bf 100644 --- a/src/coverart.rs +++ b/src/coverart.rs @@ -26,7 +26,6 @@ pub mod init { } impl CoverArt { - // TODO: Add method to save to filesystem // TODO: Add method to remove from filesystem } -- 2.43.0 From 857354697ff18d97c33cab6271ad6f88386f0abd Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 11 Oct 2025 16:07:27 -0400 Subject: [PATCH 3/3] Version bump --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5bd15fa..ef3fd86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -142,7 +142,7 @@ checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "icarus_models" -version = "0.6.3" +version = "0.6.4" dependencies = [ "josekit", "rand", diff --git a/Cargo.toml b/Cargo.toml index 6379891..5f10bcb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_models" -version = "0.6.3" +version = "0.6.4" edition = "2024" rust-version = "1.88" description = "models used for the icarus project" -- 2.43.0