Skip to content
Merged

446 #459

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@
/// assert!(bounded(2, 3).is_ok());
/// assert!(bounded(5, 3).is_err());
/// ```
///
/// Clippy format-args lints (such as `clippy::uninlined_format_args`) see
/// through this macro and lint format arguments passed inside it.
#[macro_export]
#[clippy::format_args]
macro_rules! ensure {
(cond = $cond:expr, else = $err:expr $(,)?) => {
$crate::ensure!($cond, $err)
Expand Down Expand Up @@ -102,7 +106,11 @@ macro_rules! ensure {
/// let err = reject().unwrap_err();
/// assert!(matches!(err.kind, AppErrorKind::Unauthorized));
/// ```
///
/// Clippy format-args lints (such as `clippy::uninlined_format_args`) see
/// through this macro and lint format arguments passed inside it.
#[macro_export]
#[clippy::format_args]
macro_rules! fail {
($err:expr $(,)?) => {
return Err($err);
Expand Down Expand Up @@ -170,7 +178,11 @@ macro_rules! fail {
/// AppErrorKind::Unauthorized
/// ));
/// ```
///
/// Clippy format-args lints (such as `clippy::uninlined_format_args`) see
/// through this macro and lint the format string and arguments directly.
#[macro_export]
#[clippy::format_args]
macro_rules! app_error {
($kind:expr $(,)?) => {
$crate::AppError::bare($kind)
Expand Down
Loading