This commit is contained in:
parent
708bcb0b91
commit
37c354f8a2
1 changed files with 6 additions and 3 deletions
|
@ -87,6 +87,7 @@ fn scan_files(config: &Config, found_markers: &mut FoundMarkers) -> Result<()> {
|
|||
}
|
||||
|
||||
fn scan_dir(dir: &Path, config: &Config, found_markers: &mut FoundMarkers) -> Result<()> {
|
||||
println!("dir : {}", dir.to_string_lossy());
|
||||
let read_dir = config.fs.dir_read(dir)?;
|
||||
for entry in read_dir {
|
||||
match entry? {
|
||||
|
@ -98,14 +99,16 @@ fn scan_dir(dir: &Path, config: &Config, found_markers: &mut FoundMarkers) -> Re
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn scan_file(path: &Path, config: &Config, found_markers: &mut FoundMarkers) -> Result<()> {
|
||||
fn scan_file(file: &Path, config: &Config, found_markers: &mut FoundMarkers) -> Result<()> {
|
||||
println!("file: {}", file.to_string_lossy());
|
||||
config
|
||||
.fs
|
||||
.file_read_to_string(path)?
|
||||
.file_read_to_string(file)?
|
||||
.lines()
|
||||
.enumerate()
|
||||
.filter_map(|(n, line)| prefix_match(n, line, path, config))
|
||||
.filter_map(|(n, line)| prefix_match(n, line, file, config))
|
||||
.for_each(|marker| {
|
||||
println!("- {}", marker.line.value);
|
||||
if let Some(issue) = config
|
||||
.issue_pattern
|
||||
.find(&marker.line.value)
|
||||
|
|
Loading…
Reference in a new issue