1
Fork 0

Fix util/update_wiki.py warnings and be consistent in declare_lint! invocations

This commit is contained in:
mcarton 2016-02-06 00:13:29 +01:00
parent 0494071ab7
commit 13f245f6c9
25 changed files with 341 additions and 166 deletions

View file

@ -18,9 +18,11 @@ use utils::{get_item_name, snippet, span_lint, walk_ptrs_ty};
/// **Known problems:** None
///
/// **Example:** `if x.len() == 0 { .. }`
declare_lint!(pub LEN_ZERO, Warn,
"checking `.len() == 0` or `.len() > 0` (or similar) when `.is_empty()` \
could be used instead");
declare_lint! {
pub LEN_ZERO, Warn,
"checking `.len() == 0` or `.len() > 0` (or similar) when `.is_empty()` \
could be used instead"
}
/// **What it does:** This lint checks for items that implement `.len()` but not `.is_empty()`. It is `Warn` by default.
///
@ -34,8 +36,10 @@ declare_lint!(pub LEN_ZERO, Warn,
/// fn len(&self) -> usize { .. }
/// }
/// ```
declare_lint!(pub LEN_WITHOUT_IS_EMPTY, Warn,
"traits and impls that have `.len()` but not `.is_empty()`");
declare_lint! {
pub LEN_WITHOUT_IS_EMPTY, Warn,
"traits and impls that have `.len()` but not `.is_empty()`"
}
#[derive(Copy,Clone)]
pub struct LenZero;