From a83e81393393ad35f6988b54f8d0bda12651c32f Mon Sep 17 00:00:00 2001 From: Adrian Groh Date: Tue, 13 Feb 2024 09:02:47 +0100 Subject: [PATCH] fix: ignore invalid info values instead of crashing closes #41 --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 437b484..705ea28 100644 --- a/src/main.rs +++ b/src/main.rs @@ -216,7 +216,8 @@ fn main() { Ok(pfetch_infos) => pfetch_infos .trim() .split(' ') - .map(|info| PfetchInfo::from_str(info).unwrap()) + .map(PfetchInfo::from_str) + .filter_map(|i| i.ok()) .collect(), Err(_) => vec![ PfetchInfo::Ascii,