box attribute selector, significantly reducing the size of the simple selector enum

This commit is contained in:
Connor Skees 2020-07-07 21:00:20 -04:00
parent 6a83db7404
commit 5f938315dc
2 changed files with 3 additions and 3 deletions

View File

@ -264,9 +264,9 @@ impl<'a, 'b> SelectorParser<'a, 'b> {
fn parse_attribute_selector(&mut self) -> SassResult<SimpleSelector> {
self.parser.toks.next();
Ok(SimpleSelector::Attribute(Attribute::from_tokens(
Ok(SimpleSelector::Attribute(Box::new(Attribute::from_tokens(
self.parser,
)?))
)?)))
}
fn parse_class_selector(&mut self) -> SassResult<SimpleSelector> {

View File

@ -62,7 +62,7 @@ pub(crate) enum SimpleSelector {
/// the given name.
Class(String),
Attribute(Attribute),
Attribute(Box<Attribute>),
}
impl fmt::Display for SimpleSelector {