about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-03-10 22:35:15 +0000
committerbors <bors@rust-lang.org>2020-03-10 22:35:15 +0000
commitfdce47ba7d901b91c23c5d096aef4a7fdc18dc8e (patch)
treee6e8640a54825c1ea32d176fe449b8bc8e1ed9de /src
parent9d5ffe81054890cafc1f4df20704ebdd597bd2a4 (diff)
parenta4ba1027fc581379e55dce66d0b7e21d8d91dfa0 (diff)
downloadrust-fdce47ba7d901b91c23c5d096aef4a7fdc18dc8e.tar.gz
rust-fdce47ba7d901b91c23c5d096aef4a7fdc18dc8e.zip
Auto merge of #5272 - jmeyers35:file_read_lint, r=flip1995
add lint on File::read_to_string and File::read_to_end

Adds lint `verbose_file_reads` which checks for use of File::read_to_end and File::read_to_string.

Closes https://github.com/rust-lang/rust-clippy/issues/4916

changelog: add lint on File::{read_to_end, read_to_string}
Diffstat (limited to 'src')
-rw-r--r--src/lintlist/mod.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs
index 4ae4ccc91f0..fd948953ea2 100644
--- a/src/lintlist/mod.rs
+++ b/src/lintlist/mod.rs
@@ -6,7 +6,7 @@ pub use lint::Lint;
 pub use lint::LINT_LEVELS;
 
 // begin lint list, do not remove this comment, it’s used in `update_lints`
-pub const ALL_LINTS: [Lint; 360] = [
+pub const ALL_LINTS: [Lint; 361] = [
     Lint {
         name: "absurd_extreme_comparisons",
         group: "correctness",
@@ -2402,6 +2402,13 @@ pub const ALL_LINTS: [Lint; 360] = [
         module: "bit_mask",
     },
     Lint {
+        name: "verbose_file_reads",
+        group: "complexity",
+        desc: "use of `File::read_to_end` or `File::read_to_string`",
+        deprecation: None,
+        module: "verbose_file_reads",
+    },
+    Lint {
         name: "while_immutable_condition",
         group: "correctness",
         desc: "variables used within while expression are not mutated in the body",