Skip to content

Commit 3bdc691

Browse files
committed
Pass by ref instead of value
1 parent de36d42 commit 3bdc691

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_dev/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ impl Lint {
5858
}
5959

6060
pub fn gather_all() -> impl Iterator<Item=Lint> {
61-
lint_files().flat_map(gather_from_file)
61+
lint_files().flat_map(|f| gather_from_file(&f))
6262
}
6363

64-
fn gather_from_file(dir_entry: fs::DirEntry) -> impl Iterator<Item=Lint> {
64+
fn gather_from_file(dir_entry: &fs::DirEntry) -> impl Iterator<Item=Lint> {
6565
let mut file = fs::File::open(dir_entry.path()).unwrap();
6666
let mut content = String::new();
6767
file.read_to_string(&mut content).unwrap();

0 commit comments

Comments
 (0)