Added a Message-consuming Into<Result<Command>> for ergonomics.
This commit is contained in:
parent
83c38931bf
commit
f2e8f37877
1 changed files with 6 additions and 0 deletions
|
@ -348,6 +348,12 @@ fn string(s: &'static str) -> String {
|
||||||
s.to_owned()
|
s.to_owned()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Message> for Result<Command> {
|
||||||
|
fn from(m: Message) -> Result<Command> {
|
||||||
|
(&m).into()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> From<&'a Message> for Result<Command> {
|
impl<'a> From<&'a Message> for Result<Command> {
|
||||||
/// Converts a Message into a Command.
|
/// Converts a Message into a Command.
|
||||||
fn from(m: &'a Message) -> Result<Command> {
|
fn from(m: &'a Message) -> Result<Command> {
|
||||||
|
|
Loading…
Add table
Reference in a new issue