rust std change #42

Merged
phoenix merged 11 commits from rust_std_change into devel 2025-06-29 17:37:14 +00:00
Showing only changes of commit 5b58c2b1a0 - Show all commits

View File

@@ -67,9 +67,7 @@ impl Song {
pub fn song_path(&self) -> Result<String, std::io::Error> { pub fn song_path(&self) -> Result<String, std::io::Error> {
if self.directory.is_empty() { if self.directory.is_empty() {
return Err(std::io::Error::other( return Err(std::io::Error::other("Directory does not exist"));
"Directory does not exist",
));
} }
let directory = &self.directory; let directory = &self.directory;
@@ -101,9 +99,7 @@ impl Song {
file.read_to_end(&mut buffer)?; file.read_to_end(&mut buffer)?;
if buffer.is_empty() { if buffer.is_empty() {
Err(std::io::Error::other( Err(std::io::Error::other("File is empty"))
"File is empty",
))
} else { } else {
Ok(buffer) Ok(buffer)
} }