From 055395337cd79a71be8e81160e3eab2a722c7f2c Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 19 Sep 2024 22:56:31 +0200 Subject: [PATCH] fix --- .gitignore | 4 +++- src/integrity.rs | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 911bd70..b9de5f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /target /db -/itemdb \ No newline at end of file +/itemdb +/flows +/locations \ No newline at end of file diff --git a/src/integrity.rs b/src/integrity.rs index e7f8e80..c0bc02d 100644 --- a/src/integrity.rs +++ b/src/integrity.rs @@ -34,8 +34,7 @@ pub async fn verify_integrity( .1 .next .as_ref() - .map(|x| flows.get(x).is_none()) - .unwrap_or(false) + .map_or(false, |x| flows.get(x).is_none()) { log::error!( "Flow '{}' is referencing unknown flow '{}' as next step.", @@ -51,8 +50,7 @@ pub async fn verify_integrity( .1 .parent .as_ref() - .map(|x| flows.get(x).is_none()) - .unwrap_or(false) + .map_or(false, |x| locations.get(x).is_none()) { log::error!( "Location '{}' is referencing an unknown location '{}' as parent.", @@ -66,6 +64,8 @@ pub async fn verify_integrity( if tainted { std::process::exit(1); } + + log::info!("Passed basic integrity check"); } pub fn verify_item_variant_exists(item_variant: &str, id: &str, itemdb: &ItemDB) -> Option {