Skip to content

Commit 955b268

Browse files
committed
modify lineno instead of shadowing
1 parent ee9e620 commit 955b268

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tools/jsondocck/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ fn get_directives(template: &str) -> Result<Vec<Directive>, ()> {
7676
let mut errors = false;
7777
let file = fs::read_to_string(template).unwrap();
7878

79-
for (lineno, line) in file.split('\n').enumerate() {
80-
let lineno = lineno + 1;
79+
for (mut lineno, line) in file.split('\n').enumerate() {
80+
lineno += 1;
8181

8282
if DEPRECATED_LINE_PATTERN.is_match(line) {
8383
print_err("Deprecated directive syntax, replace `// @` with `//@ `", lineno);

0 commit comments

Comments
 (0)