Selector::replace takes super selector by reference
This commit is contained in:
parent
26fdcfdf17
commit
47330a92c6
@ -106,7 +106,7 @@ impl AtRule {
|
||||
AtRuleKind::Annotation => todo!("@annotation not yet implemented"),
|
||||
AtRuleKind::AtRoot => {
|
||||
let mut selector = &Selector::replace(
|
||||
super_selector.clone(),
|
||||
super_selector,
|
||||
Selector::from_tokens(
|
||||
&mut read_until_open_curly_brace(toks).into_iter().peekable(),
|
||||
scope,
|
||||
@ -127,7 +127,7 @@ impl AtRule {
|
||||
let raw_stmts = eat_stmts_at_root(
|
||||
&mut body.into_iter().peekable(),
|
||||
scope,
|
||||
&selector,
|
||||
selector,
|
||||
0,
|
||||
is_some,
|
||||
)?
|
||||
|
@ -58,7 +58,7 @@ pub(crate) fn eat_stmts_at_root<I: Iterator<Item = Token>>(
|
||||
if nesting > 1 || is_some {
|
||||
selector = super_selector.zip(&selector);
|
||||
} else {
|
||||
selector = Selector::replace(super_selector.clone(), selector);
|
||||
selector = Selector::replace(super_selector, selector);
|
||||
}
|
||||
nesting += 1;
|
||||
let rules = eat_stmts_at_root(toks, scope, &selector, nesting, true)?;
|
||||
|
@ -374,7 +374,7 @@ impl Selector {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn replace(super_selector: Selector, this: Selector) -> Selector {
|
||||
pub fn replace(super_selector: &Selector, this: Selector) -> Selector {
|
||||
if super_selector.0.is_empty() || this.0.is_empty() {
|
||||
return this;
|
||||
}
|
||||
@ -397,7 +397,7 @@ impl Selector {
|
||||
found_inner = true;
|
||||
kinds.push(SelectorKind::PseudoParen(
|
||||
name,
|
||||
Selector::replace(super_selector.clone(), inner),
|
||||
Selector::replace(super_selector, inner),
|
||||
))
|
||||
} else {
|
||||
kinds.push(SelectorKind::PseudoParen(name, inner));
|
||||
@ -445,7 +445,7 @@ impl Selector {
|
||||
found_inner = true;
|
||||
this_selector.push(SelectorKind::PseudoParen(
|
||||
s,
|
||||
Selector::replace(self.clone(), inner_selector),
|
||||
Selector::replace(self, inner_selector),
|
||||
))
|
||||
} else {
|
||||
this_selector.push(SelectorKind::PseudoParen(s, inner_selector));
|
||||
|
Loading…
x
Reference in New Issue
Block a user