mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-23 20:34:06 +00:00
s/direntry/dir_entry
This commit is contained in:
parent
70312430dd
commit
78d358b861
@ -54,17 +54,17 @@ impl Lint {
|
|||||||
|
|
||||||
pub fn collect_all() -> Vec<Lint> {
|
pub fn collect_all() -> Vec<Lint> {
|
||||||
let mut lints = vec![];
|
let mut lints = vec![];
|
||||||
for direntry in lint_files() {
|
for dir_entry in lint_files() {
|
||||||
lints.append(&mut collect_from_file(&direntry));
|
lints.append(&mut collect_from_file(&dir_entry));
|
||||||
}
|
}
|
||||||
lints
|
lints
|
||||||
}
|
}
|
||||||
|
|
||||||
fn collect_from_file(direntry: &fs::DirEntry) -> Vec<Lint> {
|
fn collect_from_file(dir_entry: &fs::DirEntry) -> Vec<Lint> {
|
||||||
let mut file = fs::File::open(direntry.path()).unwrap();
|
let mut file = fs::File::open(dir_entry.path()).unwrap();
|
||||||
let mut content = String::new();
|
let mut content = String::new();
|
||||||
file.read_to_string(&mut content).unwrap();
|
file.read_to_string(&mut content).unwrap();
|
||||||
parse_contents(&content, direntry.path().file_stem().unwrap().to_str().unwrap())
|
parse_contents(&content, dir_entry.path().file_stem().unwrap().to_str().unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_contents(content: &str, filename: &str) -> Vec<Lint> {
|
fn parse_contents(content: &str, filename: &str) -> Vec<Lint> {
|
||||||
|
Loading…
Reference in New Issue
Block a user