Skip to content

Commit 8ac545d

Browse files
committed
Fix documentation
1 parent 4c34732 commit 8ac545d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ All notable changes to this project will be documented in this file.
7272
## ~~0.0.52~~
7373

7474
## 0.0.51 — 2016-03-13
75-
* Add `str` to types considered by `len_zero`
75+
* Add `str` to types considered by [`len_zero`]
7676
* New lints: [`indexing_slicing`]
7777

7878
## 0.0.50 — 2016-03-11

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ name
7474
[ineffective_bit_mask](https://github.com/Manishearth/rust-clippy/wiki#ineffective_bit_mask) | warn | expressions where a bit mask will be rendered useless by a comparison, e.g. `(x | 1) > 2`
7575
[inline_always](https://github.com/Manishearth/rust-clippy/wiki#inline_always) | warn | `#[inline(always)]` is a bad idea in most cases
7676
[integer_arithmetic](https://github.com/Manishearth/rust-clippy/wiki#integer_arithmetic) | allow | Any integer arithmetic statement
77-
[invalid_regex](https://github.com/Manishearth/rust-clippy/wiki#invalid_regex) | deny | finds invalid regular expressions in `Regex::new(_)` invocations
77+
[invalid_regex](https://github.com/Manishearth/rust-clippy/wiki#invalid_regex) | deny | finds invalid regular expressions
7878
[invalid_upcast_comparisons](https://github.com/Manishearth/rust-clippy/wiki#invalid_upcast_comparisons) | allow | a comparison involving an upcast which is always true or false
7979
[items_after_statements](https://github.com/Manishearth/rust-clippy/wiki#items_after_statements) | allow | finds blocks where an item comes after a statement
8080
[iter_next_loop](https://github.com/Manishearth/rust-clippy/wiki#iter_next_loop) | warn | for-looping over `_.next()` which is probably not intended
@@ -150,7 +150,7 @@ name
150150
[too_many_arguments](https://github.com/Manishearth/rust-clippy/wiki#too_many_arguments) | warn | functions with too many arguments
151151
[toplevel_ref_arg](https://github.com/Manishearth/rust-clippy/wiki#toplevel_ref_arg) | warn | An entire binding was declared as `ref`, in a function argument (`fn foo(ref x: Bar)`), or a `let` statement (`let ref x = foo()`). In such cases, it is preferred to take references with `&`.
152152
[transmute_ptr_to_ref](https://github.com/Manishearth/rust-clippy/wiki#transmute_ptr_to_ref) | warn | transmutes from a pointer to a reference type
153-
[trivial_regex](https://github.com/Manishearth/rust-clippy/wiki#trivial_regex) | warn | finds trivial regular expressions in `Regex::new(_)` invocations
153+
[trivial_regex](https://github.com/Manishearth/rust-clippy/wiki#trivial_regex) | warn | finds trivial regular expressions
154154
[type_complexity](https://github.com/Manishearth/rust-clippy/wiki#type_complexity) | warn | usage of very complex types; recommends factoring out parts into `type` definitions
155155
[unicode_not_nfc](https://github.com/Manishearth/rust-clippy/wiki#unicode_not_nfc) | allow | using a unicode literal not in NFC normal form (see [unicode tr15](http://www.unicode.org/reports/tr15/) for further information)
156156
[unit_cmp](https://github.com/Manishearth/rust-clippy/wiki#unit_cmp) | warn | comparing unit values (which is always `true` or `false`, respectively)

src/regex.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ use syntax::codemap::{Span, BytePos};
1111
use syntax::parse::token::InternedString;
1212
use utils::{is_expn_of, match_def_path, match_type, paths, span_lint, span_help_and_lint};
1313

14-
/// **What it does:** This lint checks `Regex::new(_)` invocations for correct regex syntax.
14+
/// **What it does:** This lint checks [regex] creation (with `Regex::new`, `RegexBuilder::new` or
15+
/// `RegexSet::new`) for correct regex syntax.
1516
///
1617
/// **Why is this bad?** This will lead to a runtime panic.
1718
///
@@ -21,21 +22,24 @@ use utils::{is_expn_of, match_def_path, match_type, paths, span_lint, span_help_
2122
declare_lint! {
2223
pub INVALID_REGEX,
2324
Deny,
24-
"finds invalid regular expressions in `Regex::new(_)` invocations"
25+
"finds invalid regular expressions"
2526
}
2627

27-
/// **What it does:** This lint checks for `Regex::new(_)` invocations with trivial regex.
28+
/// **What it does:** This lint checks for trivial [regex] creation (with `Regex::new`,
29+
/// `RegexBuilder::new` or `RegexSet::new`).
2830
///
2931
/// **Why is this bad?** This can likely be replaced by `==` or `str::starts_with`,
3032
/// `str::ends_with` or `std::contains` or other `str` methods.
3133
///
3234
/// **Known problems:** None.
3335
///
3436
/// **Example:** `Regex::new("^foobar")`
37+
///
38+
/// [regex]: https://crates.io/crates/regex
3539
declare_lint! {
3640
pub TRIVIAL_REGEX,
3741
Warn,
38-
"finds trivial regular expressions in `Regex::new(_)` invocations"
42+
"finds trivial regular expressions"
3943
}
4044

4145
/// **What it does:** This lint checks for usage of `regex!(_)` which as of now is usually slower than `Regex::new(_)` unless called in a loop (which is a bad idea anyway).

0 commit comments

Comments
 (0)