mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
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:
parent
2302d828a5
commit
898cafb5a5
3 changed files with 6 additions and 1 deletions
|
@ -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")
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue