Skip to content

Commit 26f4b73

Browse files
committed
updated how lines are counted in comments.rs
1 parent e406b56 commit 26f4b73

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sql_docs"
3-
version = "1.3.0"
3+
version = "1.3.1"
44
edition = "2024"
55
description = "A crate for parsing comments from sql files and using them for documentation generation"
66
documentation = "https://docs.rs/sql_docs"

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ edition = "2024"
22
max_width = 100
33
use_small_heuristics = "Max"
44
reorder_imports = true
5-
reorder_modules = true
5+
reorder_modules = true

src/comments.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,14 @@ impl Comments {
236236
let mut start_line = 1u64;
237237
let mut start_col = 1u64;
238238

239-
let mut line_num = 1u64;
240239
let mut col;
241240

242241
let mut in_single = false;
243242
let mut in_multi = false;
244243

245244
let mut buf = String::new();
246245

247-
for line in src.lines() {
246+
for (line_num, line) in (1u64..).zip(src.lines()) {
248247
col = 1;
249248
let mut chars = line.chars().peekable();
250249
while let Some(c) = chars.next() {
@@ -326,7 +325,6 @@ impl Comments {
326325
} else if in_multi {
327326
buf.push('\n');
328327
}
329-
line_num += 1;
330328
}
331329
// EOF: close any open comments
332330
if in_multi {

0 commit comments

Comments
 (0)