diff --git a/src/song.rs b/src/song.rs index 16f622d..d26299b 100644 --- a/src/song.rs +++ b/src/song.rs @@ -67,8 +67,7 @@ impl Song { pub fn song_path(&self) -> Result { if self.directory.is_empty() { - return Err(std::io::Error::new( - std::io::ErrorKind::Other, + return Err(std::io::Error::other( "Directory does not exist", )); } @@ -86,8 +85,7 @@ impl Song { Ok(buffer) } else { - Err(std::io::Error::new( - std::io::ErrorKind::Other, + Err(std::io::Error::other( "Could not access last character of directory", )) } @@ -103,8 +101,7 @@ impl Song { file.read_to_end(&mut buffer)?; if buffer.is_empty() { - Err(std::io::Error::new( - std::io::ErrorKind::Other, + Err(std::io::Error::other( "File is empty", )) } else {