about summary refs log tree commit diff
path: root/clippy_dev/src
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2018-09-06 08:19:09 +0200
committerPhilipp Hansch <dev@phansch.net>2018-09-06 08:19:09 +0200
commit3bdc691a91e3a7ac05f808772c0fbc2370fff511 (patch)
tree02af246424f2e3b7e55ad64bcbb1120137e69bbb /clippy_dev/src
parentde36d42e80864f40fb3075dc4e3389cfa0c113b2 (diff)
downloadrust-3bdc691a91e3a7ac05f808772c0fbc2370fff511.tar.gz
rust-3bdc691a91e3a7ac05f808772c0fbc2370fff511.zip
Pass by ref instead of value
Diffstat (limited to 'clippy_dev/src')
-rw-r--r--clippy_dev/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs
index 998efb142cc..a872ecf3feb 100644
--- a/clippy_dev/src/lib.rs
+++ b/clippy_dev/src/lib.rs
@@ -58,10 +58,10 @@ impl Lint {
 }
 
 pub fn gather_all() -> impl Iterator<Item=Lint> {
-    lint_files().flat_map(gather_from_file)
+    lint_files().flat_map(|f| gather_from_file(&f))
 }
 
-fn gather_from_file(dir_entry: fs::DirEntry) -> impl Iterator<Item=Lint> {
+fn gather_from_file(dir_entry: &fs::DirEntry) -> impl Iterator<Item=Lint> {
     let mut file = fs::File::open(dir_entry.path()).unwrap();
     let mut content = String::new();
     file.read_to_string(&mut content).unwrap();