diff --git a/src/finder/form_finder.rs b/src/finder/form_finder.rs index 23c593e..1840f27 100644 --- a/src/finder/form_finder.rs +++ b/src/finder/form_finder.rs @@ -62,15 +62,15 @@ impl CaptchaFinder for CaptchaFormFinder { async fn find_token(&self, req: &mut Request) -> Option> { req.form_data() .await - .map(|form| form.fields.get(&self.token_name).cloned()) .ok() + .and_then(|form| form.fields.get(&self.token_name).cloned().map(Some)) } async fn find_answer(&self, req: &mut Request) -> Option> { req.form_data() .await - .map(|form| form.fields.get(&self.answer_name).cloned()) .ok() + .and_then(|form| form.fields.get(&self.answer_name).cloned().map(Some)) } }