import error into scope of parse function

This commit is contained in:
p0lunin 2020-06-02 21:11:23 +03:00
parent a918eb4e50
commit 4e6e6afc3e

View file

@ -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.");