Cargo format
This commit is contained in:
parent
9bab810b91
commit
8c0224e983
44 changed files with 1784 additions and 611 deletions
19
src/bin.rs
19
src/bin.rs
|
|
@ -1,13 +1,22 @@
|
|||
use std::process::exit;
|
||||
use std::env;
|
||||
use std::process::exit;
|
||||
|
||||
pub fn schematics_main(run: &dyn Fn (bool) -> Result<(), ()>) {
|
||||
pub fn schematics_main(run: &dyn Fn(bool) -> Result<(), ()>) {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
let dry_run = match args.len() {
|
||||
1 => false,
|
||||
2 => if args[1] == "--dry-run" { true } else { panic!() },
|
||||
_ => panic!()
|
||||
2 => {
|
||||
if args[1] == "--dry-run" {
|
||||
true
|
||||
} else {
|
||||
panic!()
|
||||
}
|
||||
}
|
||||
_ => panic!(),
|
||||
};
|
||||
|
||||
exit(match run(dry_run) { Ok(_) => 0, Err(_) => 1 });
|
||||
exit(match run(dry_run) {
|
||||
Ok(_) => 0,
|
||||
Err(_) => 1,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue