Added Some to attempt.url() and removed unwrap

This commit is contained in:
James Wykeham-Martin 2018-02-02 15:41:00 +00:00
parent 7a0e7708be
commit a007460029

View File

@ -45,7 +45,7 @@ fn download_into(
info!("Redirect Attempt URL: {:?}", attempt.url());
if attempt.previous().len() > 5 {
attempt.too_many_redirects()
} else if attempt.url() == attempt.previous().last().unwrap() {
} else if Some(attempt.url()) == attempt.previous().last() {
attempt.loop_detected()
} else {
attempt.follow()