From 518f0b284f844a0bb8071fca756f388bcba64c8d Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Sun, 25 Sep 2022 18:12:20 -0400 Subject: [PATCH] Add method to check job extension on path --- src/job.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/job.rs b/src/job.rs index 142e23b..1c0dacd 100644 --- a/src/job.rs +++ b/src/job.rs @@ -63,6 +63,20 @@ impl Job { }; } + pub fn has_job_file_extension(path: &Path) -> bool { + match path.extension() { + Some(x) => { + if ! "job".eq(x) { + return false; + } + }, + None => { + return false; + } + }; + return true; + } + pub fn new(url: &str, selector: &str, conf: &Conf) -> Job { let mut job = Job::default(conf); job.url = url.to_string();