style: Use debug_unreachable!() in matches_simple_selector

This shrinks the function by avoiding generating rather noisy panic
code.

Depends on D145486

Differential Revision: https://phabricator.services.mozilla.com/D145487
This commit is contained in:
Emilio Cobos Álvarez 2022-05-07 04:02:26 +00:00 committed by Martin Robinson
parent 2302d828a5
commit 898cafb5a5
3 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,7 @@ use crate::parser::{AncestorHashes, Combinator, Component, LocalName};
use crate::parser::{NonTSPseudoClass, Selector, SelectorImpl, SelectorIter, SelectorList};
use crate::tree::Element;
use bitflags::bitflags;
use debug_unreachable::debug_unreachable;
use log::debug;
use smallvec::SmallVec;
use std::borrow::Borrow;
@ -832,7 +833,9 @@ where
}
true
}),
Component::Combinator(_) => unreachable!(),
Component::Combinator(_) => unsafe {
debug_unreachable!("Shouldn't try to selector-match combinators")
},
}
}