Skip to content

Commit

Permalink
Auto merge of #5376 - flip1995:verbose_file_reads_restriction, r=matt…
Browse files Browse the repository at this point in the history
…hiaskrgr

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
  • Loading branch information
bors committed Mar 27, 2020
2 parents 64befe5 + 7a40b5c commit 70b93aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]);
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
]);

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/verbose_file_reads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
}

Expand Down
2 changes: 1 addition & 1 deletion src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 70b93aa

Please sign in to comment.