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> {
|
||||
/// Constructs a new `MatchingContext`.
|
||||
pub fn new(matching_mode: MatchingMode,
|
||||
pub fn new(
|
||||
matching_mode: MatchingMode,
|
||||
bloom_filter: Option<&'a BloomFilter>,
|
||||
nth_index_cache: Option<&'a mut NthIndexCache>,
|
||||
quirks_mode: QuirksMode)
|
||||
-> Self
|
||||
{
|
||||
Self {
|
||||
matching_mode: matching_mode,
|
||||
bloom_filter: bloom_filter,
|
||||
nth_index_cache: nth_index_cache,
|
||||
visited_handling: VisitedHandlingMode::AllLinksUnvisited,
|
||||
relevant_link_found: false,
|
||||
quirks_mode: quirks_mode,
|
||||
classes_and_ids_case_sensitivity: quirks_mode.classes_and_ids_case_sensitivity(),
|
||||
}
|
||||
quirks_mode: QuirksMode,
|
||||
) -> Self {
|
||||
Self::new_for_visited(
|
||||
matching_mode,
|
||||
bloom_filter,
|
||||
nth_index_cache,
|
||||
VisitedHandlingMode::AllLinksUnvisited,
|
||||
quirks_mode
|
||||
)
|
||||
}
|
||||
|
||||
/// Constructs a new `MatchingContext` for use in visited matching.
|
||||
pub fn new_for_visited(matching_mode: MatchingMode,
|
||||
pub fn new_for_visited(
|
||||
matching_mode: MatchingMode,
|
||||
bloom_filter: Option<&'a BloomFilter>,
|
||||
nth_index_cache: Option<&'a mut NthIndexCache>,
|
||||
visited_handling: VisitedHandlingMode,
|
||||
quirks_mode: QuirksMode)
|
||||
-> Self
|
||||
{
|
||||
quirks_mode: QuirksMode,
|
||||
) -> Self {
|
||||
Self {
|
||||
matching_mode: matching_mode,
|
||||
bloom_filter: bloom_filter,
|
||||
visited_handling: visited_handling,
|
||||
matching_mode,
|
||||
bloom_filter,
|
||||
visited_handling,
|
||||
nth_index_cache,
|
||||
quirks_mode,
|
||||
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(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue