Minor refactoring
This commit is contained in:
parent
e454558faa
commit
e19e405781
10
src/lib.rs
10
src/lib.rs
@ -366,12 +366,17 @@ impl BenchmarkRepository
|
|||||||
Some(content.to_owned())
|
Some(content.to_owned())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn result_repository_path(&self, job_id: u32) -> PathBuf
|
||||||
|
{
|
||||||
|
self.base_path.join(format!("job-{}", job_id))
|
||||||
|
}
|
||||||
|
|
||||||
pub fn create_result_repository(&mut self) -> Job
|
pub fn create_result_repository(&mut self) -> Job
|
||||||
{
|
{
|
||||||
let job_id = self.jobs;
|
let job_id = self.jobs;
|
||||||
self.jobs += 1;
|
self.jobs += 1;
|
||||||
|
|
||||||
let result_repository_path = self.base_path.join(format!("job-{}", job_id));
|
let result_repository_path = self.result_repository_path(job_id);
|
||||||
|
|
||||||
if result_repository_path.exists()
|
if result_repository_path.exists()
|
||||||
{
|
{
|
||||||
@ -416,8 +421,7 @@ impl BenchmarkRepository
|
|||||||
(
|
(
|
||||||
|job_id|
|
|job_id|
|
||||||
{
|
{
|
||||||
let job_repository_path = self.base_path.join(format!("job-{}", job_id));
|
let job_repository_path = self.result_repository_path(*job_id);
|
||||||
|
|
||||||
let job_repository = match Repository::open(&job_repository_path)
|
let job_repository = match Repository::open(&job_repository_path)
|
||||||
{
|
{
|
||||||
Ok(value) => value,
|
Ok(value) => value,
|
||||||
|
Loading…
Reference in New Issue
Block a user