Skip to content
Snippets Groups Projects
Commit 164f6209 authored by Shawn Tabrizi's avatar Shawn Tabrizi Committed by GitHub
Browse files

Implement From<DispatchError> for '&static str (#4856)

parent ec562fe9
No related merge requests found
......@@ -405,13 +405,13 @@ impl From<&'static str> for DispatchError {
}
}
impl Into<&'static str> for DispatchError {
fn into(self) -> &'static str {
match self {
Self::Other(msg) => msg,
Self::CannotLookup => "Can not lookup",
Self::BadOrigin => "Bad origin",
Self::Module { message, .. } => message.unwrap_or("Unknown module error"),
impl From<DispatchError> for &'static str {
fn from(err: DispatchError) -> &'static str {
match err {
DispatchError::Other(msg) => msg,
DispatchError::CannotLookup => "Can not lookup",
DispatchError::BadOrigin => "Bad origin",
DispatchError::Module { message, .. } => message.unwrap_or("Unknown module error"),
}
}
}
......
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