Merge pull request #1225 from dave-tucker/fix-clippy

chore(aya): Fix clippy unused cfg_attr
reviewable/pr1063/r14
Dave Tucker 4 weeks ago committed by GitHub
commit d9ef2df2f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -438,28 +438,30 @@ macro_rules! impl_try_from_map {
// rather than the repeated idents used later because the macro language does not allow one // rather than the repeated idents used later because the macro language does not allow one
// repetition to be pasted inside another. // repetition to be pasted inside another.
($ty_param:tt { ($ty_param:tt {
$($ty:ident $(from $($variant:ident)|+)?),+ $(,)? $($(#[$meta:meta])* $ty:ident $(from $($variant:ident)|+)?),+ $(,)?
}) => { }) => {
$(impl_try_from_map!(<$ty_param> $ty $(from $($variant)|+)?);)+ $(impl_try_from_map!($(#[$meta])* <$ty_param> $ty $(from $($variant)|+)?);)+
}; };
// Add the "from $variant" using $ty as the default if it is missing. // Add the "from $variant" using $ty as the default if it is missing.
(<$ty_param:tt> $ty:ident) => { ($(#[$meta:meta])* <$ty_param:tt> $ty:ident) => {
impl_try_from_map!(<$ty_param> $ty from $ty); impl_try_from_map!($(#[$meta])* <$ty_param> $ty from $ty);
}; };
// Dispatch for each of the lifetimes. // Dispatch for each of the lifetimes.
( (
<($($ty_param:ident),*)> $ty:ident from $($variant:ident)|+ $(#[$meta:meta])* <($($ty_param:ident),*)> $ty:ident from $($variant:ident)|+
) => { ) => {
impl_try_from_map!(<'a> ($($ty_param),*) $ty from $($variant)|+); impl_try_from_map!($(#[$meta])* <'a> ($($ty_param),*) $ty from $($variant)|+);
impl_try_from_map!(<'a mut> ($($ty_param),*) $ty from $($variant)|+); impl_try_from_map!($(#[$meta])* <'a mut> ($($ty_param),*) $ty from $($variant)|+);
impl_try_from_map!(<> ($($ty_param),*) $ty from $($variant)|+); impl_try_from_map!($(#[$meta])* <> ($($ty_param),*) $ty from $($variant)|+);
}; };
// An individual impl. // An individual impl.
( (
$(#[$meta:meta])*
<$($l:lifetime $($m:ident)?)?> <$($l:lifetime $($m:ident)?)?>
($($ty_param:ident),*) ($($ty_param:ident),*)
$ty:ident from $($variant:ident)|+ $ty:ident from $($variant:ident)|+
) => { ) => {
$(#[$meta])*
impl<$($l,)? $($ty_param: Pod),*> TryFrom<$(&$l $($m)?)? Map> impl<$($l,)? $($ty_param: Pod),*> TryFrom<$(&$l $($m)?)? Map>
for $ty<$(&$l $($m)?)? MapData, $($ty_param),*> for $ty<$(&$l $($m)?)? MapData, $($ty_param),*>
{ {
@ -487,11 +489,8 @@ impl_try_from_map!(() {
SockMap, SockMap,
StackTraceMap, StackTraceMap,
XskMap, XskMap,
}); #[cfg(any(feature = "async_tokio", feature = "async_std"))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "async_tokio", feature = "async_std"))))]
#[cfg(any(feature = "async_tokio", feature = "async_std"))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "async_tokio", feature = "async_std"))))]
impl_try_from_map!(() {
AsyncPerfEventArray from PerfEventArray, AsyncPerfEventArray from PerfEventArray,
}); });

Loading…
Cancel
Save