From ac4f30ce9efdd629f162395fdea1b569cb8fb116 Mon Sep 17 00:00:00 2001 From: SadlyNotSappho Date: Wed, 23 Aug 2023 12:45:56 -0700 Subject: [PATCH] change types in Page and change variable names to align better with the intended struct --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e7ee58d..867a915 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,8 +55,8 @@ pub struct Config { pub struct Page { pub date: String, - pub next_page: bool, - pub prev_page: bool, + pub next_page: Option, + pub prev_page: Option, pub image: String, } @@ -72,10 +72,10 @@ pub async fn get_page(date: String) { let parsed = Html::parse_document(page_html); + // get image url for this page let selector = Selector::parse("img[alt=Comic]").unwrap(); - let mut url = String::new(); + let mut image = String::new(); for element in parsed.select(&selector) { - url = element.value().attr("src").unwrap().replace('"', ""); + image = element.value().attr("src").unwrap().replace('"', ""); } - println!("{url}"); }