tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 48e2f9b824f06720223b79f7badde42937e616ed
parent 5996cbc7049d8b288a04a9f0efa78c0e3cd11527
Author: noriaki watanabe <nabeyang@gmail.com>
Date:   Wed, 17 Dec 2025 23:09:02 +0000

Bug 2006777 - Remove unused generic parameters from try_parse_combinator in selectors parser r=emilio,firefox-style-system-reviewers

The function `try_parse_combinator` in `servo/components/selectors/parser.rs` previously declared
two generic type parameters (`P` and `Impl`) that were not referenced or utilized in the function
body. Call sites also invoked the function with explicit type arguments, even though the parser
logic did not depend on any generic behavior from those types.

This change simplifies the API by removing the unused type parameters from the function signature
and eliminating the need for explicit generic arguments at the call sites. The functionality and
behavior of the selector parser remain unchanged.

No functional impact or semantic changes are introduced by this refactor. This cleanup improves
readability and aligns the signature with its actual usage.

Differential Revision: https://phabricator.services.mozilla.com/D276935

Diffstat:
Mservo/components/selectors/parser.rs | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/servo/components/selectors/parser.rs b/servo/components/selectors/parser.rs @@ -2796,7 +2796,7 @@ where input.skip_whitespace(); if parse_relative != ParseRelative::No { - let combinator = try_parse_combinator::<P, Impl>(input); + let combinator = try_parse_combinator(input); match parse_relative { ParseRelative::ForHas => { builder.push_simple_selector(Component::RelativeSelectorAnchor); @@ -2842,7 +2842,7 @@ where break; } - let combinator = if let Ok(c) = try_parse_combinator::<P, Impl>(input) { + let combinator = if let Ok(c) = try_parse_combinator(input) { c } else { break 'outer_loop; @@ -2857,7 +2857,7 @@ where return Ok(Selector(builder.build(parse_relative))); } -fn try_parse_combinator<'i, 't, P, Impl>(input: &mut CssParser<'i, 't>) -> Result<Combinator, ()> { +fn try_parse_combinator<'i, 't>(input: &mut CssParser<'i, 't>) -> Result<Combinator, ()> { let mut any_whitespace = false; loop { let before_this_token = input.state();