Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ToCss for Selector #153

Merged
merged 1 commit into from
Oct 19, 2023
Merged

feat: ToCss for Selector #153

merged 1 commit into from
Oct 19, 2023

Conversation

EdJoPaTo
Copy link
Contributor

I would like to use ToCss for the Selector. Selector is basically a wrapper of the cssparser::SelectorList which implements this trait too.

SelectorList is containing exactly the content of Selector::selectors but with redeclaring it and requiring the explicit dependency on smallvec. Changing this removes smallvec as a direct dependency. This should even have the same memory footprint as Rust optimizes the wrapper struct away.

Using pub for the use ToCSS is probably debatable but I think its a good thing to easily allow to use to_css and to_css_string without specifying the cssparser dependency explicitly and rather use scraper::selector::ToCss instead.

Copy link
Member

@adamreichold adamreichold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplification!

@cfvescovo
Copy link
Member

LGTM

@cfvescovo cfvescovo merged commit 8bc800d into rust-scraper:master Oct 19, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants