rust std change #42
@@ -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)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user