summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-12-05 11:38:07 +0200
committerLars Wirzenius <liw@liw.fi>2021-12-05 11:38:07 +0200
commitf750b4b68f4c86f1344ea6f5b34e9767c1e2f7b6 (patch)
tree76371c4c8988a6bb8629dbcc3c365807f26067be /src
parenteb71541a3779f576eedccc0b365eb2241f201930 (diff)
downloadobnam-benchmark-f750b4b68f4c86f1344ea6f5b34e9767c1e2f7b6.tar.gz
refactor: move things around for clarity
Sponsored-by: author
Diffstat (limited to 'src')
-rw-r--r--src/bin/obnam-benchmark.rs34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/bin/obnam-benchmark.rs b/src/bin/obnam-benchmark.rs
index 5d4f06a..bc9c7de 100644
--- a/src/bin/obnam-benchmark.rs
+++ b/src/bin/obnam-benchmark.rs
@@ -4,6 +4,23 @@ use std::path::PathBuf;
use std::process::exit;
use structopt::StructOpt;
+fn main() {
+ if let Err(err) = real_main() {
+ eprintln!("ERROR: {}", err);
+ exit(1);
+ }
+}
+
+fn real_main() -> anyhow::Result<()> {
+ let opt = Opt::from_args();
+
+ match opt.cmd {
+ Command::Spec(x) => x.run()?,
+ }
+
+ Ok(())
+}
+
#[derive(Debug, StructOpt)]
struct Opt {
#[structopt(subcommand)]
@@ -24,23 +41,6 @@ struct Spec {
output: PathBuf,
}
-fn main() {
- if let Err(err) = real_main() {
- eprintln!("ERROR: {}", err);
- exit(1);
- }
-}
-
-fn real_main() -> anyhow::Result<()> {
- let opt = Opt::from_args();
-
- match opt.cmd {
- Command::Spec(x) => x.run()?,
- }
-
- Ok(())
-}
-
impl Spec {
fn run(&self) -> anyhow::Result<()> {
let input = File::open(&self.spec)?;