From 7ae20f8733a1117ee695998729450a4fc85ccd8d Mon Sep 17 00:00:00 2001 From: Stephen D <webmaster@scd31.com> Date: Fri, 24 Nov 2023 21:17:32 -0400 Subject: [PATCH] simple callsign sanity check --- src/config.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 16f63a0..b9ecded 100644 --- a/src/config.rs +++ b/src/config.rs @@ -35,7 +35,11 @@ pub struct Config { impl Config { pub fn load() -> anyhow::Result<Self> { let file_contents = read_conf_file()?; - let config = toml::from_str(&file_contents).context("parsing config file")?; + let config: Self = toml::from_str(&file_contents).context("parsing config file")?; + + if config.callsign == "CHANGEME" { + bail!("Callsign is not configured in config file"); + } Ok(config) } -- GitLab