Skip to content

Add trait to abstract over selectable collections of elements#155

Merged
cfvescovo merged 4 commits intorust-scraper:masterfrom
adamreichold:selectable-trait
Nov 9, 2023
Merged

Add trait to abstract over selectable collections of elements#155
cfvescovo merged 4 commits intorust-scraper:masterfrom
adamreichold:selectable-trait

Conversation

@adamreichold
Copy link
Member

@adamreichold adamreichold commented Oct 28, 2023

Our codebase contains a simpler version of this trait which we use to write helper functions which can be applied both at the top level to Html but also if selection is a multi-step process, i.e. to ElementRef itself, as the scope to which a CSS selector is applied.

Note that this uses generic associated type and hence requires Rust 1.65, c.f. https://blog.rust-lang.org/2022/10/28/gats-stabilization.html.

@cfvescovo
Copy link
Member

LGTM

@cfvescovo cfvescovo merged commit e140459 into rust-scraper:master Nov 9, 2023
@adamreichold adamreichold deleted the selectable-trait branch November 9, 2023 06:13
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.

2 participants