diff options
| author | Philipp Krones <hello@philkrones.com> | 2018-09-28 15:26:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-28 15:26:50 +0200 |
| commit | 67d85bc47dbfa6c5d37bdfe09e45b746e31c4804 (patch) | |
| tree | 7012d928a6a56bf85d7a5992cb2eedd14d7d8ad8 /clippy_dev | |
| parent | 8e808664fa0148e983f7b1ed1d5696454a3c026d (diff) | |
| parent | 9fae4693f9d3a7f4e5784b81f726d22c7cd5cb2f (diff) | |
| download | rust-67d85bc47dbfa6c5d37bdfe09e45b746e31c4804.tar.gz rust-67d85bc47dbfa6c5d37bdfe09e45b746e31c4804.zip | |
Merge pull request #3224 from matthiaskrgr/clippy_self__use_self
fix some clippy::pedantic warnings found in the codebase.
Diffstat (limited to 'clippy_dev')
| -rw-r--r-- | clippy_dev/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs index e5ce8580fa1..2f91c987cb1 100644 --- a/clippy_dev/src/lib.rs +++ b/clippy_dev/src/lib.rs @@ -35,8 +35,8 @@ pub struct Lint { } impl Lint { - pub fn new(name: &str, group: &str, desc: &str, deprecation: Option<&str>, module: &str) -> Lint { - Lint { + pub fn new(name: &str, group: &str, desc: &str, deprecation: Option<&str>, module: &str) -> Self { + Self { name: name.to_lowercase(), group: group.to_string(), desc: NL_ESCAPE_RE.replace(&desc.replace("\\\"", "\""), "").to_string(), @@ -46,12 +46,12 @@ impl Lint { } /// Returns all non-deprecated lints - pub fn active_lints(lints: &[Lint]) -> impl Iterator<Item=&Lint> { + pub fn active_lints(lints: &[Self]) -> impl Iterator<Item=&Self> { lints.iter().filter(|l| l.deprecation.is_none()) } /// Returns the lints in a HashMap, grouped by the different lint groups - pub fn by_lint_group(lints: &[Lint]) -> HashMap<String, Vec<Lint>> { + pub fn by_lint_group(lints: &[Self]) -> HashMap<String, Vec<Self>> { lints.iter().map(|lint| (lint.group.to_string(), lint.clone())).into_group_map() } } |
