sniff-cli 0.1.2

An exhaustive LLM-backed slop finder for codebases
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub struct LineIndex {
    pub(crate) line_starts: Vec<usize>,
}

impl LineIndex {
    pub fn new(source: &str) -> Self {
        let mut line_starts = vec![0];
        for (i, c) in source.char_indices() {
            if c == '\n' {
                line_starts.push(i + 1);
            }
        }
        LineIndex { line_starts }
    }
}