diff options
| author | bors <bors@rust-lang.org> | 2020-03-27 20:13:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-03-27 20:13:06 +0000 |
| commit | 70b93aab6ec576c3665f38fd485bb5e0154a88f7 (patch) | |
| tree | 87b1a0ecec9cf188cf6a2fa19dc848398b15df07 | |
| parent | 64befe59cc814ddb89b73f810febed0fc8425cf5 (diff) | |
| parent | 7a40b5c132abb50801e4f91bd67d05aba1435d54 (diff) | |
| download | rust-70b93aab6ec576c3665f38fd485bb5e0154a88f7.tar.gz rust-70b93aab6ec576c3665f38fd485bb5e0154a88f7.zip | |
Auto merge of #5376 - flip1995:verbose_file_reads_restriction, r=matthiaskrgr
Move verbose_file_reads to restriction cc #5368 Using `File::read` instead of `fs::read_to_end` does make sense in multiple cases, so this lint is rather restriction, than complexity changelog: Move [`verbose_file_reads`] to restriction
| -rw-r--r-- | clippy_lints/src/lib.rs | 3 | ||||
| -rw-r--r-- | clippy_lints/src/verbose_file_reads.rs | 2 | ||||
| -rw-r--r-- | src/lintlist/mod.rs | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 108e28235c4..140500afe0f 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1064,6 +1064,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&shadow::SHADOW_REUSE), LintId::of(&shadow::SHADOW_SAME), LintId::of(&strings::STRING_ADD), + LintId::of(&verbose_file_reads::VERBOSE_FILE_READS), LintId::of(&write::PRINT_STDOUT), LintId::of(&write::USE_DEBUG), ]); @@ -1382,7 +1383,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&unwrap::PANICKING_UNWRAP), LintId::of(&unwrap::UNNECESSARY_UNWRAP), LintId::of(&vec::USELESS_VEC), - LintId::of(&verbose_file_reads::VERBOSE_FILE_READS), LintId::of(&write::PRINTLN_EMPTY_STRING), LintId::of(&write::PRINT_LITERAL), LintId::of(&write::PRINT_WITH_NEWLINE), @@ -1565,7 +1565,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&types::UNNECESSARY_CAST), LintId::of(&types::VEC_BOX), LintId::of(&unwrap::UNNECESSARY_UNWRAP), - LintId::of(&verbose_file_reads::VERBOSE_FILE_READS), LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO), ]); diff --git a/clippy_lints/src/verbose_file_reads.rs b/clippy_lints/src/verbose_file_reads.rs index 37885317c58..55d7983249a 100644 --- a/clippy_lints/src/verbose_file_reads.rs +++ b/clippy_lints/src/verbose_file_reads.rs @@ -26,7 +26,7 @@ declare_clippy_lint! { /// let mut bytes = fs::read("foo.txt").unwrap(); /// ``` pub VERBOSE_FILE_READS, - complexity, + restriction, "use of `File::read_to_end` or `File::read_to_string`" } diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs index 0cf094b8ed3..2888741cb45 100644 --- a/src/lintlist/mod.rs +++ b/src/lintlist/mod.rs @@ -2410,7 +2410,7 @@ pub const ALL_LINTS: [Lint; 362] = [ }, Lint { name: "verbose_file_reads", - group: "complexity", + group: "restriction", desc: "use of `File::read_to_end` or `File::read_to_string`", deprecation: None, module: "verbose_file_reads", |
