mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +01:00
Apply suggestions from code review
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
This commit is contained in:
parent
27ef3409c2
commit
c7f38981a4
1 changed files with 9 additions and 5 deletions
|
@ -92,7 +92,7 @@ macro_rules! match_prefix {
|
||||||
("") => {{
|
("") => {{
|
||||||
|data: &str| Some(data.to_owned())
|
|data: &str| Some(data.to_owned())
|
||||||
}};
|
}};
|
||||||
($prefix: literal) => {{
|
($prefix:literal) => {{
|
||||||
|data: &str| {
|
|data: &str| {
|
||||||
if data.starts_with($prefix) {
|
if data.starts_with($prefix) {
|
||||||
Some(data.to_owned())
|
Some(data.to_owned())
|
||||||
|
@ -105,10 +105,14 @@ macro_rules! match_prefix {
|
||||||
|
|
||||||
macro_rules! impl_api_error {
|
macro_rules! impl_api_error {
|
||||||
(
|
(
|
||||||
$(#[$meta: meta])*
|
$( #[$meta:meta] )*
|
||||||
$vis: vis enum $ident: ident {
|
$vis:vis enum $ident:ident {
|
||||||
$($(#[$var_meta: meta])*
|
$(
|
||||||
$var_name: ident$(($var_inner: ty))? = $var_string: literal $(with $var_parser: block)?),* } ) => {
|
$( #[$var_meta:meta] )*
|
||||||
|
$var_name:ident $( ($var_inner:ty) )? = $var_string:literal $(with $var_parser: block)?
|
||||||
|
),*
|
||||||
|
}
|
||||||
|
) => {
|
||||||
|
|
||||||
$(#[$meta])*
|
$(#[$meta])*
|
||||||
#[derive(Error)]
|
#[derive(Error)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue