fix: ignore invalid info values instead of crashing

closes #41
This commit is contained in:
Adrian Groh 2024-02-13 09:02:47 +01:00
parent b8f490587f
commit a83e813933
Signed by: Gobidev
GPG Key ID: 3AA3153E98B0D771

View File

@ -216,7 +216,8 @@ fn main() {
Ok(pfetch_infos) => pfetch_infos Ok(pfetch_infos) => pfetch_infos
.trim() .trim()
.split(' ') .split(' ')
.map(|info| PfetchInfo::from_str(info).unwrap()) .map(PfetchInfo::from_str)
.filter_map(|i| i.ok())
.collect(), .collect(),
Err(_) => vec![ Err(_) => vec![
PfetchInfo::Ascii, PfetchInfo::Ascii,