Open MikkelPaulson opened 3 months ago
What kind of testing did you have in mind? I changed that to
fn get_root_element() -> Option<Element> {
// #[allow(static_mut_refs)]
if let Some(element_id) = unsafe { (*addr_of!(ROOT_ELEMENT_ID)).clone() } {
window()
.and_then(|w| w.document())
.and_then(|d| d.get_element_by_id(&element_id))
} else {
None
}
}
and I ran test.sh
and all the existing tests passed.
@ThinkerDreamer There are no end-to-end tests (#61), so this case probably wouldn't be covered. It will need to be tested manually. If the website loads at all, the change is valid.
Okay, I'll try it and see 👍🏻
Clippy sez:
This needs a bit of testing to verify that it has no side effects, but "hard error in 2024" sounds bad.