Skip to content

Commit ffbe52e

Browse files
committed
Add whitelists of macros that need special-case format
1 parent 72cac8b commit ffbe52e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/expr.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,18 @@ fn rewrite_string_lit(context: &RewriteContext, span: Span, shape: Shape) -> Opt
18071807
)
18081808
}
18091809

1810+
const FORMAT_LIKE_WHITELIST: &[&str] = &[
1811+
"eprint!",
1812+
"eprintln!",
1813+
"format!",
1814+
"format_args!",
1815+
"panic!",
1816+
"println!",
1817+
"unreachable!",
1818+
];
1819+
1820+
const WRITE_LIKE_WHITELIST: &[&str] = &["assert!", "write!", "writeln!"];
1821+
18101822
pub fn rewrite_call(
18111823
context: &RewriteContext,
18121824
callee: &str,

0 commit comments

Comments
 (0)