tidy up bitsy-validate
This commit is contained in:
parent
d53d1d73d0
commit
cf29fd43dc
10
README.md
10
README.md
|
@ -17,13 +17,11 @@ extern crate bitsy_parser;
|
||||||
use bitsy_parser::game::Game;
|
use bitsy_parser::game::Game;
|
||||||
use std::{env, fs};
|
use std::{env, fs};
|
||||||
|
|
||||||
|
const SYNTAX_ERROR: &str = "No input path specified. Usage: `bitsy-validate filepath`";
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let input_file = env::args()
|
let input = env::args().nth(1).expect(SYNTAX_ERROR);
|
||||||
.nth(1)
|
Game::from(fs::read_to_string(input).unwrap()).unwrap();
|
||||||
.expect("No input path specified. Usage: `bitsy-validate filepath`");
|
|
||||||
|
|
||||||
Game::from(fs::read_to_string(input_file).unwrap()).unwrap();
|
|
||||||
|
|
||||||
println!("OK!");
|
println!("OK!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::{env, fs};
|
||||||
const SYNTAX_ERROR: &str = "No input path specified. Usage: `bitsy-validate filepath`";
|
const SYNTAX_ERROR: &str = "No input path specified. Usage: `bitsy-validate filepath`";
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let input_file = env::args().nth(1).expect(SYNTAX_ERROR);
|
let input = env::args().nth(1).expect(SYNTAX_ERROR);
|
||||||
Game::from(fs::read_to_string(input_file).unwrap()).unwrap();
|
Game::from(fs::read_to_string(input).unwrap()).unwrap();
|
||||||
println!("OK!");
|
println!("OK!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue