]> git.lizzy.rs Git - rust.git/commitdiff
Add whitelists of macros that need special-case format
authortopecongiro <seuchida@gmail.com>
Fri, 1 Dec 2017 04:28:36 +0000 (13:28 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Sun, 3 Dec 2017 02:34:18 +0000 (11:34 +0900)
src/expr.rs

index afa319830469e4d8e6da448415f85bbdc842fe57..ce2ea65b65aaade761d7a37d67c5d4e26413122e 100644 (file)
@@ -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(
     context: &RewriteContext,
     callee: &str,