diff options
Diffstat (limited to 'src/tools/clippy/src/docs/write_with_newline.txt')
-rw-r--r-- | src/tools/clippy/src/docs/write_with_newline.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/write_with_newline.txt b/src/tools/clippy/src/docs/write_with_newline.txt new file mode 100644 index 000000000..22845fd65 --- /dev/null +++ b/src/tools/clippy/src/docs/write_with_newline.txt @@ -0,0 +1,18 @@ +### What it does +This lint warns when you use `write!()` with a format +string that +ends in a newline. + +### Why is this bad? +You should use `writeln!()` instead, which appends the +newline. + +### Example +``` +write!(buf, "Hello {}!\n", name); +``` + +Use instead: +``` +writeln!(buf, "Hello {}!", name); +```
\ No newline at end of file |