clippy: tor-error: Use convert::identity for into_internal!

This launders the closure so that clippy's
clippy::redundant_closure_call can't see it.

We can't have a local #[allow] because it would be on an expression,
which isn't allowed on stable.

This avoids having to use more clumsy idioms at call sites.
This commit is contained in:
Ian Jackson 2023-07-10 13:38:24 +01:00
parent 1a8395cd11
commit fd2e4979be
1 changed files with 4 additions and 0 deletions

View File

@ -215,7 +215,9 @@ macro_rules! bad_api_usage {
#[macro_export]
macro_rules! into_internal {
{ $( $arg:tt )* } => {
std::convert::identity( // Hides the IEFI from clippy::redundant_closure_call
|source| $crate::Bug::from_error($crate::ErrorKind::Internal, source, format!($($arg)*))
)
}
}
@ -237,7 +239,9 @@ macro_rules! into_internal {
#[macro_export]
macro_rules! into_bad_api_usage {
{ $( $arg:tt )* } => {
std::convert::identity( // Hides the IEFI from clippy::redundant_closure_call
|source| $crate::Bug::from_error($crate::ErrorKind::BadApiUsage, source, format!($($arg)*))
)
}
}