diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-12-05 18:01:31 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-12-05 18:01:31 +0200 |
commit | 7ed2a28e3c7fb2e17095e63bd4153031d507cc71 (patch) | |
tree | 73bfdef2e15218558981955cd8df11c2f6523a2b /src | |
parent | 494db061417627c3f5847fd7b4c47248e5d8d2ea (diff) | |
download | obnam-benchmark-7ed2a28e3c7fb2e17095e63bd4153031d507cc71.tar.gz |
refactor: move execution into Step, from main
Sponsored-by: author
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/obnam-benchmark.rs | 2 | ||||
-rw-r--r-- | src/lib.rs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/obnam-benchmark.rs b/src/bin/obnam-benchmark.rs index 3c2060e..b36565e 100644 --- a/src/bin/obnam-benchmark.rs +++ b/src/bin/obnam-benchmark.rs @@ -48,7 +48,7 @@ impl Run { fn run(&self) -> anyhow::Result<()> { let spec = Specification::from_file(&self.spec)?; for step in spec.steps() { - println!("{:?}", step); + step.execute()?; } Ok(()) } @@ -147,4 +147,11 @@ impl Step { Change::Delete(x) => Self::Delete(x.clone()), } } + + pub fn execute(&self) -> Result<(), SpecificationError> { + println!("execute {:?}", self); + let t = std::time::Duration::from_millis(1000); + std::thread::sleep(t); + Ok(()) + } } |