From 0e1ebccd9c2639533657f5254ddec7a14a71f7e9 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 28 Apr 2025 16:36:24 -0400 Subject: [PATCH] Don't panic when parsing certain item names --- src/parser.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index df62c71..9d60f97 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -224,11 +224,11 @@ fn parse_item_tooltip(element: &scraper::ElementRef<'_>) -> Option { .select(&Selector::parse(".db-tooltip__item__name").unwrap()) .nth(0) { - let text: String = slot.text().collect(); - let item_name = text.strip_suffix("\u{e03c}").unwrap(); - return Some(ItemValue { - name: item_name.to_string(), - }); + let mut text: String = slot.text().collect(); + if text.contains("\u{e03c}") { + text = text.strip_suffix("\u{e03c}").unwrap().to_string(); + } + return Some(ItemValue { name: text }); } None