From 9a96f4dfb684cea2f511ebabc249114f3ef8ddeb Mon Sep 17 00:00:00 2001 From: Noah Swerhun Date: Fri, 15 Mar 2024 08:50:40 -0500 Subject: [PATCH] skip target if it already exists --- src/main.rs | 5 ++++- src/parse_deser/target_list.rs | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index adc00e7..f6ed841 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ use core::panic; -use std::{collections::HashMap, env::args, fs::read_to_string, process::exit}; +use std::{collections::HashMap, fs::read_to_string, process::exit}; use clap::Parser; @@ -56,6 +56,9 @@ fn main() { let mut target_list: TargetList = TargetList(HashMap::new()); for order in &inheritance_order { for name in order.into_iter().rev() { + if let Some(_) = target_list.0.get(name as &str) { + continue; + } let opts = target_option_list.0.get(name as &str).unwrap(); let deser = deser_target_list.get(name as &str).unwrap(); diff --git a/src/parse_deser/target_list.rs b/src/parse_deser/target_list.rs index a0f319a..e421064 100644 --- a/src/parse_deser/target_list.rs +++ b/src/parse_deser/target_list.rs @@ -1,5 +1,4 @@ use super::*; -use crate::deser::*; use std::collections::HashMap; #[derive(Debug, Clone)]