tsk-49: Code formatting
This commit is contained in:
@@ -7,7 +7,6 @@ pub struct FileType {
|
|||||||
pub file_type: String,
|
pub file_type: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Initializes a FileType given a filetype passed.
|
/// Initializes a FileType given a filetype passed.
|
||||||
pub fn init_filetype(filetype: &str) -> Result<FileType, std::io::Error> {
|
pub fn init_filetype(filetype: &str) -> Result<FileType, std::io::Error> {
|
||||||
if filetype == song::constants::FLAC_TYPE {
|
if filetype == song::constants::FLAC_TYPE {
|
||||||
@@ -20,12 +19,16 @@ pub fn init_filetype(filetype: &str) -> Result<FileType, std::io::Error> {
|
|||||||
mime: String::from(coverart::constants::mime::PNG),
|
mime: String::from(coverart::constants::mime::PNG),
|
||||||
file_type: String::from(coverart::constants::PNG_TYPE),
|
file_type: String::from(coverart::constants::PNG_TYPE),
|
||||||
})
|
})
|
||||||
} else if filetype == coverart::constants::JPEG_TYPE || filetype == coverart::constants::JPG_TYPE {
|
} else if filetype == coverart::constants::JPEG_TYPE
|
||||||
|
|| filetype == coverart::constants::JPG_TYPE
|
||||||
|
{
|
||||||
Ok(FileType {
|
Ok(FileType {
|
||||||
mime: String::from(coverart::constants::mime::JPEG),
|
mime: String::from(coverart::constants::mime::JPEG),
|
||||||
file_type: String::from(coverart::constants::JPEG_TYPE),
|
file_type: String::from(coverart::constants::JPEG_TYPE),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Err(std::io::Error::other(format!("Unsupported FileType: {filetype:?}")))
|
Err(std::io::Error::other(format!(
|
||||||
|
"Unsupported FileType: {filetype:?}"
|
||||||
|
)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user