added wiki comments + wiki-generating python script

This commit is contained in:
llogiq 2015-12-11 01:22:27 +01:00
parent 2fbe762a99
commit 5bbc1427fd
28 changed files with 668 additions and 0 deletions

View file

@ -6,8 +6,22 @@ use syntax::visit::FnKind;
use utils::{span_lint, snippet, match_path_ast, in_external_macro};
/// **What it does:** This lint checks for return statements at the end of a block. It is `Warn` by default.
///
/// **Why is this bad?** Removing the `return` and semicolon will make the code more rusty.
///
/// **Known problems:** None
///
/// **Example:** `fn foo(x: usize) { return x; }`
declare_lint!(pub NEEDLESS_RETURN, Warn,
"using a return statement like `return expr;` where an expression would suffice");
/// **What it does:** This lint checks for `let`-bindings, which are subsequently returned. It is `Warn` by default.
///
/// **Why is this bad?** It is just extraneous code. Remove it to make your code more rusty.
///
/// **Known problems:** None
///
/// **Example:** `{ let x = ..; x }`
declare_lint!(pub LET_AND_RETURN, Warn,
"creating a let-binding and then immediately returning it like `let x = expr; x` at \
the end of a block");