Skip to content

Commit

Permalink
refactor(dispatcher): use anyhow to replace special error
Browse files Browse the repository at this point in the history
In higher-order function,we don't care the type of errors
  • Loading branch information
itsusinn committed Oct 17, 2021
1 parent 08647aa commit 9604c97
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/despatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ pub async fn cmd_or_msg_repl_with_listener<N, Cmd, CH, MH, FutC, FutM, L, Listen
Cmd: BotCommand + Send + 'static,

CH: Fn(Arc<UpdateWithCx<AutoSend<Bot>, Message>>, Cmd) -> FutC + Send + Sync + 'static,
FutC: Future<Output = Result<(), ErrC>> + Send + 'static,
Result<(), ErrC>: OnError<ErrC>,
ErrC: Debug + Send,
FutC: Future<Output = anyhow::Result<()>> + Send + 'static,

MH: Fn(Arc<UpdateWithCx<AutoSend<Bot>, Message>>, String) -> FutM + Send + Sync + 'static,
FutM: Future<Output = Result<(), ErrM>> + Send + 'static,
Result<(), ErrM>: OnError<ErrM>,
ErrM: Debug + Send,
MH: Fn(Arc<UpdateWithCx<AutoSend<Bot>, Message>>) -> FutM + Send + Sync + 'static,
FutM: Future<Output = anyhow::Result<()>> + Send + 'static,

N: Into<String> + Send + Clone + 'static,

Expand Down

0 comments on commit 9604c97

Please sign in to comment.