mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +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));
|
let matching_values = infos.iter().map(|c| c.get_matched_value(global));
|
||||||
|
|
||||||
quote! {
|
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
|
where
|
||||||
N: Into<String>
|
N: Into<String>
|
||||||
{
|
{
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
use teloxide::utils::ParseError;
|
||||||
|
|
||||||
let mut words = s.splitn(2, ' ');
|
let mut words = s.splitn(2, ' ');
|
||||||
let mut splited = words.next().expect("First item will be always.").split('@');
|
let mut splited = words.next().expect("First item will be always.").split('@');
|
||||||
let command_raw = splited.next().expect("First item will be always.");
|
let command_raw = splited.next().expect("First item will be always.");
|
||||||
|
|
Loading…
Add table
Reference in a new issue