mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #18773 - emilio:mc-cleanup, r=nox
style: Cleanup MatchingContext construction. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18773) <!-- Reviewable:end -->
This commit is contained in:
commit
438b9df00c
1 changed files with 25 additions and 27 deletions
|
@ -94,38 +94,36 @@ pub struct MatchingContext<'a> {
|
||||||
|
|
||||||
impl<'a> MatchingContext<'a> {
|
impl<'a> MatchingContext<'a> {
|
||||||
/// Constructs a new `MatchingContext`.
|
/// Constructs a new `MatchingContext`.
|
||||||
pub fn new(matching_mode: MatchingMode,
|
pub fn new(
|
||||||
bloom_filter: Option<&'a BloomFilter>,
|
matching_mode: MatchingMode,
|
||||||
nth_index_cache: Option<&'a mut NthIndexCache>,
|
bloom_filter: Option<&'a BloomFilter>,
|
||||||
quirks_mode: QuirksMode)
|
nth_index_cache: Option<&'a mut NthIndexCache>,
|
||||||
-> Self
|
quirks_mode: QuirksMode,
|
||||||
{
|
) -> Self {
|
||||||
Self {
|
Self::new_for_visited(
|
||||||
matching_mode: matching_mode,
|
matching_mode,
|
||||||
bloom_filter: bloom_filter,
|
bloom_filter,
|
||||||
nth_index_cache: nth_index_cache,
|
nth_index_cache,
|
||||||
visited_handling: VisitedHandlingMode::AllLinksUnvisited,
|
VisitedHandlingMode::AllLinksUnvisited,
|
||||||
relevant_link_found: false,
|
quirks_mode
|
||||||
quirks_mode: quirks_mode,
|
)
|
||||||
classes_and_ids_case_sensitivity: quirks_mode.classes_and_ids_case_sensitivity(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Constructs a new `MatchingContext` for use in visited matching.
|
/// Constructs a new `MatchingContext` for use in visited matching.
|
||||||
pub fn new_for_visited(matching_mode: MatchingMode,
|
pub fn new_for_visited(
|
||||||
bloom_filter: Option<&'a BloomFilter>,
|
matching_mode: MatchingMode,
|
||||||
nth_index_cache: Option<&'a mut NthIndexCache>,
|
bloom_filter: Option<&'a BloomFilter>,
|
||||||
visited_handling: VisitedHandlingMode,
|
nth_index_cache: Option<&'a mut NthIndexCache>,
|
||||||
quirks_mode: QuirksMode)
|
visited_handling: VisitedHandlingMode,
|
||||||
-> Self
|
quirks_mode: QuirksMode,
|
||||||
{
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
matching_mode: matching_mode,
|
matching_mode,
|
||||||
bloom_filter: bloom_filter,
|
bloom_filter,
|
||||||
visited_handling: visited_handling,
|
visited_handling,
|
||||||
|
nth_index_cache,
|
||||||
|
quirks_mode,
|
||||||
relevant_link_found: false,
|
relevant_link_found: false,
|
||||||
nth_index_cache: nth_index_cache,
|
|
||||||
quirks_mode: quirks_mode,
|
|
||||||
classes_and_ids_case_sensitivity: quirks_mode.classes_and_ids_case_sensitivity(),
|
classes_and_ids_case_sensitivity: quirks_mode.classes_and_ids_case_sensitivity(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue