mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Merge pull request #693 from teloxide/nicer_filter_ext_docs
Make filter ext docs a little bit nicer
Former-commit-id: acd3f4f9a2
This commit is contained in:
commit
2df4dfd61b
1 changed files with 4 additions and 4 deletions
|
@ -56,11 +56,11 @@ mod private {
|
||||||
macro_rules! define_message_ext {
|
macro_rules! define_message_ext {
|
||||||
($( ($func:ident, $fn_name:path) ,)*) => {
|
($( ($func:ident, $fn_name:path) ,)*) => {
|
||||||
define_ext! {
|
define_ext! {
|
||||||
MessageFilterExt, crate::types::Message =>
|
MessageFilterExt, Message =>
|
||||||
$((
|
$((
|
||||||
$func,
|
$func,
|
||||||
(|x| $fn_name(&x).map(ToOwned::to_owned)),
|
(|x| $fn_name(&x).map(ToOwned::to_owned)),
|
||||||
concat!("Applies the [`crate::types::", stringify!($fn_name), "`] filter.")
|
concat!("Applies the [`", stringify!($fn_name), "`] filter.")
|
||||||
),)*
|
),)*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,14 +89,14 @@ define_message_ext! {
|
||||||
macro_rules! define_update_ext {
|
macro_rules! define_update_ext {
|
||||||
($( ($func:ident, $kind:path, $Allowed:ident) ,)*) => {
|
($( ($func:ident, $kind:path, $Allowed:ident) ,)*) => {
|
||||||
define_ext! {
|
define_ext! {
|
||||||
UpdateFilterExt, crate::types::Update =>
|
UpdateFilterExt, Update =>
|
||||||
$((
|
$((
|
||||||
$func,
|
$func,
|
||||||
|update: Update| match update.kind {
|
|update: Update| match update.kind {
|
||||||
$kind(x) => Some(x),
|
$kind(x) => Some(x),
|
||||||
_ => None,
|
_ => None,
|
||||||
},
|
},
|
||||||
concat!("Filters out [`crate::types::", stringify!($kind), "`] objects."),
|
concat!("Filters out [`", stringify!($kind), "`] objects."),
|
||||||
$Allowed
|
$Allowed
|
||||||
),)*
|
),)*
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue