Small grammar, punctuation, and code style improvements to docs
This commit is contained in:
parent
831aa9607a
commit
034244f108
6 changed files with 9 additions and 9 deletions
|
|
@ -69,7 +69,7 @@ declare_clippy_lint! {
|
|||
}
|
||||
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:** Checks for comparing to an empty slice such as "" or [],`
|
||||
/// **What it does:** Checks for comparing to an empty slice such as `""` or `[]`,
|
||||
/// and suggests using `.is_empty()` where applicable.
|
||||
///
|
||||
/// **Why is this bad?** Some structures can answer `.is_empty()` much faster
|
||||
|
|
|
|||
|
|
@ -1351,7 +1351,7 @@ declare_clippy_lint! {
|
|||
}
|
||||
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:** Checks for usage of `_.map(_).collect::<Result<(),_>()`.
|
||||
/// **What it does:** Checks for usage of `_.map(_).collect::<Result<(), _>()`.
|
||||
///
|
||||
/// **Why is this bad?** Using `try_for_each` instead is more readable and idiomatic.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use std::convert::TryFrom;
|
|||
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:** Checks [regex](https://crates.io/crates/regex) creation
|
||||
/// (with `Regex::new`,`RegexBuilder::new` or `RegexSet::new`) for correct
|
||||
/// (with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`) for correct
|
||||
/// regex syntax.
|
||||
///
|
||||
/// **Why is this bad?** This will lead to a runtime panic.
|
||||
|
|
@ -29,7 +29,7 @@ declare_clippy_lint! {
|
|||
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:** Checks for trivial [regex](https://crates.io/crates/regex)
|
||||
/// creation (with `Regex::new`, `RegexBuilder::new` or `RegexSet::new`).
|
||||
/// creation (with `Regex::new`, `RegexBuilder::new`, or `RegexSet::new`).
|
||||
///
|
||||
/// **Why is this bad?** Matching the regex can likely be replaced by `==` or
|
||||
/// `str::starts_with`, `str::ends_with` or `std::contains` or other `str`
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ declare_clippy_lint! {
|
|||
/// **Example:**
|
||||
///
|
||||
/// ```rust
|
||||
/// let mut twins = vec!((1,1), (2,2));
|
||||
/// let mut twins = vec!((1, 1), (2, 2));
|
||||
/// twins.sort_by_key(|x| { x.1; });
|
||||
/// ```
|
||||
pub UNIT_RETURN_EXPECTING_ORD,
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ use rustc_session::{declare_tool_lint, impl_lint_pass};
|
|||
use rustc_span::sym;
|
||||
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:** Checks for `Into`, `TryInto`, `From`, `TryFrom`,`IntoIter` calls
|
||||
/// that useless converts to the same type as caller.
|
||||
/// **What it does:** Checks for `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` calls
|
||||
/// that uselessly convert to the same type.
|
||||
///
|
||||
/// **Why is this bad?** Redundant code.
|
||||
///
|
||||
|
|
@ -31,7 +31,7 @@ declare_clippy_lint! {
|
|||
/// ```
|
||||
pub USELESS_CONVERSION,
|
||||
complexity,
|
||||
"calls to `Into`, `TryInto`, `From`, `TryFrom`, `IntoIter` that performs useless conversions to the same type"
|
||||
"calls to `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` that perform useless conversions to the same type"
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue