Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
redox-os
syscall
Commits
d230cc98
Commit
d230cc98
authored
Jun 24, 2018
by
Michael Aaron Murphy
Browse files
Give Error::text() a static lifetime
parent
495b0974
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/error.rs
View file @
d230cc98
...
...
@@ -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"
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment