mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-18 15:20:15 +01:00
adapt to teloxide changes
This commit is contained in:
parent
3d3e3eb310
commit
a2a79e29cb
2 changed files with 3 additions and 6 deletions
|
@ -18,4 +18,4 @@ heck = "0.4.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
# XXX: Do not enable `macros` feature
|
# XXX: Do not enable `macros` feature
|
||||||
teloxide = { git = "https://github.com/teloxide/teloxide.git", rev = "4246455" }
|
teloxide = { git = "https://github.com/teloxide/teloxide.git", rev = "b5e237a8a22f9f987b6e4245b9b6c3ca1f804c19" }
|
||||||
|
|
|
@ -102,10 +102,7 @@ fn impl_parse(
|
||||||
let matching_values = infos.iter().map(|c| c.get_prefixed_command());
|
let matching_values = infos.iter().map(|c| c.get_prefixed_command());
|
||||||
|
|
||||||
quote! {
|
quote! {
|
||||||
fn parse<N>(s: &str, bot_name: N) -> Result<Self, teloxide::utils::command::ParseError>
|
fn parse(s: &str, bot_name: &str) -> Result<Self, teloxide::utils::command::ParseError> {
|
||||||
where
|
|
||||||
N: Into<String>
|
|
||||||
{
|
|
||||||
// FIXME: we should probably just call a helper function from `teloxide`, instead of parsing command syntax ourselves
|
// FIXME: we should probably just call a helper function from `teloxide`, instead of parsing command syntax ourselves
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use teloxide::utils::command::ParseError;
|
use teloxide::utils::command::ParseError;
|
||||||
|
@ -121,7 +118,7 @@ fn impl_parse(
|
||||||
let bot_username = full_command.next();
|
let bot_username = full_command.next();
|
||||||
match bot_username {
|
match bot_username {
|
||||||
None => {}
|
None => {}
|
||||||
Some(username) if username.eq_ignore_ascii_case(&bot_name.into()) => {}
|
Some(username) if username.eq_ignore_ascii_case(bot_name) => {}
|
||||||
Some(n) => return Err(ParseError::WrongBotName(n.to_owned())),
|
Some(n) => return Err(ParseError::WrongBotName(n.to_owned())),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue