mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Cleanup MatchingContext construction.
This commit is contained in:
parent
8dece5e74e
commit
36223fc16d
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