diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/semicolon_if_nothing_returned.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/semicolon_if_nothing_returned.txt b/src/tools/clippy/src/docs/semicolon_if_nothing_returned.txt new file mode 100644 index 000000000..30c963ca2 --- /dev/null +++ b/src/tools/clippy/src/docs/semicolon_if_nothing_returned.txt @@ -0,0 +1,20 @@ +### What it does +Looks for blocks of expressions and fires if the last expression returns +`()` but is not followed by a semicolon. + +### Why is this bad? +The semicolon might be optional but when extending the block with new +code, it doesn't require a change in previous last line. + +### Example +``` +fn main() { + println!("Hello world") +} +``` +Use instead: +``` +fn main() { + println!("Hello world"); +} +```
\ No newline at end of file |