diff options
Diffstat (limited to 'src/tools/clippy/src/docs/needless_return.txt')
-rw-r--r-- | src/tools/clippy/src/docs/needless_return.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/needless_return.txt b/src/tools/clippy/src/docs/needless_return.txt new file mode 100644 index 000000000..48782cb0c --- /dev/null +++ b/src/tools/clippy/src/docs/needless_return.txt @@ -0,0 +1,19 @@ +### What it does +Checks for return statements at the end of a block. + +### Why is this bad? +Removing the `return` and semicolon will make the code +more rusty. + +### Example +``` +fn foo(x: usize) -> usize { + return x; +} +``` +simplify to +``` +fn foo(x: usize) -> usize { + x +} +```
\ No newline at end of file |