Clippy changes
Some checks failed
Rust Build / Check (pull_request) Failing after 25s
Rust Build / Test Suite (pull_request) Failing after 26s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Failing after 28s
Rust Build / build (pull_request) Failing after 25s

This commit is contained in:
2025-03-21 21:48:07 -04:00
parent ce13ca6a77
commit 5a4e27af39
4 changed files with 19 additions and 25 deletions

View File

@@ -96,18 +96,18 @@ impl Default for Song {
impl Song {
pub fn to_metadata_json(&self, pretty: bool) -> Result<String, serde_json::Error> {
if pretty {
return serde_json::to_string_pretty(&self);
serde_json::to_string_pretty(&self)
} else {
return serde_json::to_string(&self);
serde_json::to_string(&self)
}
}
pub fn song_path(&self) -> Result<String, std::io::Error> {
if self.directory.is_empty() {
return Err(std::io::Error::new(
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Directory does not exist",
));
))
}
let directory = &self.directory;
@@ -121,12 +121,12 @@ impl Song {
buffer += &self.filename.clone();
return Ok(buffer);
Ok(buffer)
} else {
return Err(std::io::Error::new(
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Could not access last character of directory",
));
))
}
}
@@ -140,17 +140,15 @@ impl Song {
file.read_to_end(&mut buffer)?;
if buffer.len() == 0 {
return Err(std::io::Error::new(
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"File is empty",
));
))
} else {
return Ok(buffer);
Ok(buffer)
}
}
Err(er) => {
return Err(er);
}
Err(er) => Err(er),
}
}