Skip to content

Commit

Permalink
Add another early out
Browse files Browse the repository at this point in the history
  • Loading branch information
theodore-s-beers committed Mar 28, 2022
1 parent cee0c34 commit 0fc3595
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ async fn index(path: web::Path<String>) -> impl Responder {

let lines: Vec<ElementRef> = parsed.select(&line_selector).collect();

if lines.is_empty() {
return HttpResponse::Ok().body("Something went wrong!");
}

let mut collected = String::new();

for element in lines {
Expand Down

0 comments on commit 0fc3595

Please sign in to comment.