Merge branch 'static-err' into 'master'
Give Error::text() a static lifetime See merge request redox-os/syscall!29
This commit is contained in:
+2
-6
@@ -28,12 +28,8 @@ impl Error {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn text(&self) -> &str {
|
||||
if let Some(description) = STR_ERROR.get(self.errno as usize) {
|
||||
description
|
||||
} else {
|
||||
"Unknown Error"
|
||||
}
|
||||
pub fn text(&self) -> &'static str {
|
||||
STR_ERROR.get(self.errno as usize).map(|&x| x).unwrap_or("Unknown Error")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user