summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/print_with_newline.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/src/docs/print_with_newline.txt')
-rw-r--r--src/tools/clippy/src/docs/print_with_newline.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/print_with_newline.txt b/src/tools/clippy/src/docs/print_with_newline.txt
new file mode 100644
index 000000000..640323e82
--- /dev/null
+++ b/src/tools/clippy/src/docs/print_with_newline.txt
@@ -0,0 +1,16 @@
+### What it does
+This lint warns when you use `print!()` with a format
+string that ends in a newline.
+
+### Why is this bad?
+You should use `println!()` instead, which appends the
+newline.
+
+### Example
+```
+print!("Hello {}!\n", name);
+```
+use println!() instead
+```
+println!("Hello {}!", name);
+``` \ No newline at end of file