Fix warnings

This commit is contained in:
Joscha 2023-08-16 02:57:32 +02:00
parent 470449f36e
commit 6050415fce
2 changed files with 2 additions and 4 deletions

View file

@ -11,7 +11,6 @@ use tracing::error;
use crate::{
config::WorkerServerConfig,
shared::{BenchMethod, FinishedRun, Measurement, Run, Source, UnfinishedRun},
somehow,
};
use super::server::Server;

View file

@ -29,7 +29,7 @@ struct Counts {
todos_by_dir: HashMap<String, usize>,
}
fn count(run: &RunInProgress, path: &Path) -> somehow::Result<Counts> {
fn count(path: &Path) -> somehow::Result<Counts> {
let todo_regex = RegexBuilder::new(r"[^a-z]todo[^a-z]")
.case_insensitive(true)
.build()
@ -174,10 +174,9 @@ impl RunInProgress {
&self,
server: &Server,
) -> somehow::Result<Option<Finished>> {
let run = self.clone();
let dir = server.download_repo(&self.run.hash).await?;
let path = dir.path().to_path_buf();
let counts = tokio::task::spawn_blocking(move || count(&run, &path)).await??;
let counts = tokio::task::spawn_blocking(move || count(&path)).await??;
Ok(Some(Finished {
exit_code: 0,
measurements: measurements(counts),