From 8f2e9b9add5d178363a6553cbf305c02d884a7bf Mon Sep 17 00:00:00 2001 From: Jake Hillion Date: Tue, 10 May 2022 22:24:27 +0100 Subject: [PATCH] fixed extension checking --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index a4c6065..0733e5e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 {