@@ -4,22 +4,19 @@ mod utils;
44
55use {
66 std:: {
7- error:: Error ,
87 fmt:: {
98 self ,
109 Display ,
1110 Formatter ,
1211 } ,
1312 str:: FromStr ,
1413 } ,
15- teloxide:: utils:: command:: {
16- ParseError ,
17- ParseError :: IncorrectFormat ,
18- } ,
14+ teloxide:: utils:: command:: ParseError ,
1915} ;
2016
2117#[ derive( Debug , PartialEq , Clone ) ]
2218pub enum MemeAction {
19+ Help ,
2320 List ,
2421 Search ,
2522 Info ,
@@ -37,16 +34,15 @@ impl FromStr for MemeAction {
3734 "search" => Ok ( MemeAction :: Search ) ,
3835 "random" => Ok ( MemeAction :: Random ) ,
3936 "generate" => Ok ( MemeAction :: Generate ) ,
40- _ => Err ( IncorrectFormat (
41- Box :: < dyn Error + Send + Sync + ' static > :: from ( "Unknown MemeAction" ) ,
42- ) ) ,
37+ _ => Ok ( MemeAction :: Help ) ,
4338 }
4439 }
4540}
4641
4742impl Display for MemeAction {
4843 fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
4944 match self {
45+ MemeAction :: Help => write ! ( f, "help" ) ,
5046 MemeAction :: Info => write ! ( f, "info" ) ,
5147 MemeAction :: List => write ! ( f, "list" ) ,
5248 MemeAction :: Search => write ! ( f, "search" ) ,
0 commit comments