fixed extension checking
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jake Hillion 2022-05-10 22:24:27 +01:00 committed by Gitea
parent 0e06334057
commit 8f2e9b9add

View File

@ -30,7 +30,7 @@ pub struct RunArgs<'a> {
pub fn run(args: &RunArgs) -> Result<()> {
// parse the specification
let spec: Specification = if let Some(m) = args.spec {
if m.ends_with(".json") {
if m.extension().map(|e| e == "json") == Some(true) {
let f = std::fs::File::open(m)?;
Ok(serde_json::from_reader(f)?)
} else {