Small grammar, punctuation, and code style improvements to docs

This commit is contained in:
Carol (Nichols || Goulding) 2020-11-21 15:00:03 -05:00
parent 831aa9607a
commit 034244f108
No known key found for this signature in database
GPG Key ID: D04B39A6CA243902
6 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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.
///

View File

@ -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`

View File

@ -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,

View File

@ -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)]

View File

@ -2751,7 +2751,7 @@ vec![
Lint {
name: "useless_conversion",
group: "complexity",
desc: "calls to `Into`, `TryInto`, `From`, `TryFrom`, `IntoIter` that performs useless conversions to the same type",
desc: "calls to `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` which perform useless conversions to the same type",
deprecation: None,
module: "useless_conversion",
},