(&mut self, ctx: &SessionContext, path: &Path)
| 476 | } |
| 477 | |
| 478 | async fn process_file(&mut self, ctx: &SessionContext, path: &Path) -> Result<()> { |
| 479 | debug!("Processing file {}", path.display()); |
| 480 | |
| 481 | let mut replacement_mapping = self.replacement_mapping.clone(); |
| 482 | insert_replacement( |
| 483 | &mut replacement_mapping, |
| 484 | "FILE_PATH", |
| 485 | path.to_string_lossy().into_owned(), |
| 486 | ); |
| 487 | |
| 488 | let mut reader = BenchmarkFileReader::new(path, replacement_mapping)?; |
| 489 | let mut line = String::with_capacity(1024); |
| 490 | let mut reader_result = reader.read_line(&mut line); |
| 491 | |
| 492 | while let Some(result) = reader_result { |
| 493 | match result { |
| 494 | Ok(_) => { |
| 495 | if !is_blank_or_comment_line(&line) { |
| 496 | // boxing required because of recursion |
| 497 | Box::pin(self.process_line(ctx, &mut reader, &mut line)).await?; |
| 498 | } |
| 499 | } |
| 500 | Err(e) => return Err(e), |
| 501 | } |
| 502 | |
| 503 | // Clear the line buffer for the next iteration. |
| 504 | line.clear(); |
| 505 | reader_result = reader.read_line(&mut line); |
| 506 | } |
| 507 | |
| 508 | Ok(()) |
| 509 | } |
| 510 | |
| 511 | async fn process_line( |
| 512 | &mut self, |
no test coverage detected