Add whitelists of macros that need special-case format
This commit is contained in:
parent
72cac8beae
commit
ffbe52eb76
12
src/expr.rs
12
src/expr.rs
@ -1807,6 +1807,18 @@ fn rewrite_string_lit(context: &RewriteContext, span: Span, shape: Shape) -> Opt
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const FORMAT_LIKE_WHITELIST: &[&str] = &[
|
||||||
|
"eprint!",
|
||||||
|
"eprintln!",
|
||||||
|
"format!",
|
||||||
|
"format_args!",
|
||||||
|
"panic!",
|
||||||
|
"println!",
|
||||||
|
"unreachable!",
|
||||||
|
];
|
||||||
|
|
||||||
|
const WRITE_LIKE_WHITELIST: &[&str] = &["assert!", "write!", "writeln!"];
|
||||||
|
|
||||||
pub fn rewrite_call(
|
pub fn rewrite_call(
|
||||||
context: &RewriteContext,
|
context: &RewriteContext,
|
||||||
callee: &str,
|
callee: &str,
|
||||||
|
Loading…
Reference in New Issue
Block a user