mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
import error into scope of parse function
This commit is contained in:
parent
a918eb4e50
commit
4e6e6afc3e
1 changed files with 3 additions and 1 deletions
|
@ -123,11 +123,13 @@ fn impl_parse(
|
|||
let matching_values = infos.iter().map(|c| c.get_matched_value(global));
|
||||
|
||||
quote! {
|
||||
fn parse<N>(s: &str, bot_name: N) -> Result<Self, ParseError>
|
||||
fn parse<N>(s: &str, bot_name: N) -> Result<Self, teloxide::utils::ParseError>
|
||||
where
|
||||
N: Into<String>
|
||||
{
|
||||
use std::str::FromStr;
|
||||
use teloxide::utils::ParseError;
|
||||
|
||||
let mut words = s.splitn(2, ' ');
|
||||
let mut splited = words.next().expect("First item will be always.").split('@');
|
||||
let command_raw = splited.next().expect("First item will be always.");
|
||||
|
|
Loading…
Reference in a new issue