I just realized you can chain multiple unwraps.

81 points ryankopf

I just realized today that it is okay to chain multiple packagings in an "If let" statement

if let Ok(Some(element)) = document().query_selector(".loading") {
element.remove();
}

Instead of

if let Ok(result) = document().query_selector(".loading") {
if let Some(element) = result {
element.remove();
}
}

Representing document().query_selector(".loading").unwrap().unwrap()

And it should have been obvious I just hadn't tried it sooner.