Skip to content

Commit

Permalink
chore: removed unused val + fixed while loop conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonVirgo committed Aug 3, 2024
1 parent 9f01b0a commit 2f9e6b4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/routes/api/dashboard/vote_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ async fn scrape_votes(state: Data<AppState>, path: web::Path<String>) -> impl Re
let thread_id = path.into_inner();
let mut url = ForumURL::new(thread_id.clone());


let mut is_last_page = false;
let mut current_page = 0;
let mut last_page = 1;
while current_page < last_page {
while current_page <= last_page {
match url.ppp(200).start(current_page * 200).scrape().await {
Some(page) => {
for vote in page.votes {
Expand All @@ -122,7 +120,6 @@ async fn scrape_votes(state: Data<AppState>, path: web::Path<String>) -> impl Re
},
None => {
println!("Failed to get page data for page {:?}", current_page);
is_last_page = true;
}
};

Expand Down

0 comments on commit 2f9e6b4

Please sign in to comment.