Commit e7e21296 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Merge branch 'static-err' into 'master'

Give Error::text() a static lifetime

See merge request !29
parents 495b0974 d230cc98
...@@ -28,12 +28,8 @@ impl Error { ...@@ -28,12 +28,8 @@ impl Error {
} }
} }
pub fn text(&self) -> &str { pub fn text(&self) -> &'static str {
if let Some(description) = STR_ERROR.get(self.errno as usize) { STR_ERROR.get(self.errno as usize).map(|&x| x).unwrap_or("Unknown Error")
description
} else {
"Unknown Error"
}
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment