From b44c31d8d49a24e256fbb741bb17aceda80e92c1 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Fri, 7 Jan 2022 12:19:39 +0100 Subject: [PATCH] Simplify link extractor --- src/ilias.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ilias.rs b/src/ilias.rs index 2a01f52..11b0f37 100644 --- a/src/ilias.rs +++ b/src/ilias.rs @@ -29,8 +29,7 @@ static IL_CONTENT_CONTAINER: Lazy = Lazy::new(|| Selector::parse("#il_ static BLOCK_FAVORITES: Lazy = Lazy::new(|| Selector::parse("#block_pditems_0").unwrap()); static ITEM_PROP: Lazy = Lazy::new(|| Selector::parse("span.il_ItemProperty").unwrap()); static CONTAINER_ITEMS: Lazy = Lazy::new(|| Selector::parse("div.il_ContainerListItem, .il-std-item").unwrap()); -static CONTAINER_ITEM_TITLE: Lazy = Lazy::new(|| Selector::parse("a.il_ContainerItemTitle").unwrap()); -static CONTAINER_ITEM_TITLE_ALTERNATIVE: Lazy = Lazy::new(|| Selector::parse(".il-item-title > a").unwrap()); +static CONTAINER_ITEM_TITLE: Lazy = Lazy::new(|| Selector::parse("a.il_ContainerItemTitle, .il-item-title > a").unwrap()); pub struct ILIAS { pub opt: Opt, @@ -261,7 +260,6 @@ impl ILIAS { .flat_map(|item| { item.select(&CONTAINER_ITEM_TITLE) .next() - .or_else(|| item.select(&CONTAINER_ITEM_TITLE_ALTERNATIVE).next()) .map(|link| Object::from_link(item, link)) // items without links are ignored })