File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7272/// assert!(bounded(2, 3).is_ok());
7373/// assert!(bounded(5, 3).is_err());
7474/// ```
75+ ///
76+ /// Clippy format-args lints (such as `clippy::uninlined_format_args`) see
77+ /// through this macro and lint format arguments passed inside it.
7578#[ macro_export]
79+ #[ clippy:: format_args]
7680macro_rules! ensure {
7781 ( cond = $cond: expr, else = $err: expr $( , ) ?) => {
7882 $crate:: ensure!( $cond, $err)
@@ -102,7 +106,11 @@ macro_rules! ensure {
102106/// let err = reject().unwrap_err();
103107/// assert!(matches!(err.kind, AppErrorKind::Unauthorized));
104108/// ```
109+ ///
110+ /// Clippy format-args lints (such as `clippy::uninlined_format_args`) see
111+ /// through this macro and lint format arguments passed inside it.
105112#[ macro_export]
113+ #[ clippy:: format_args]
106114macro_rules! fail {
107115 ( $err: expr $( , ) ?) => {
108116 return Err ( $err) ;
@@ -170,7 +178,11 @@ macro_rules! fail {
170178/// AppErrorKind::Unauthorized
171179/// ));
172180/// ```
181+ ///
182+ /// Clippy format-args lints (such as `clippy::uninlined_format_args`) see
183+ /// through this macro and lint the format string and arguments directly.
173184#[ macro_export]
185+ #[ clippy:: format_args]
174186macro_rules! app_error {
175187 ( $kind: expr $( , ) ?) => {
176188 $crate:: AppError :: bare( $kind)
You can’t perform that action at this time.
0 commit comments