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

Add doc comments for cosmetic filter structs/methods #61

Merged
merged 2 commits into from
Jan 2, 2020

Conversation

antonok-edm
Copy link
Collaborator

As per brave/brave-core#3303 (comment) I wanted to make sure it's very clear how the cosmetic filtering interface is to be used.

@antonok-edm antonok-edm requested a review from AndriusA December 12, 2019 22:21
@antonok-edm antonok-edm self-assigned this Dec 12, 2019
@antonok-edm antonok-edm force-pushed the extra-cosmetic-filter-docs branch from 9dc3682 to 7e10975 Compare December 16, 2019 23:24
@antonok-edm
Copy link
Collaborator Author

Should be as simple as this:

let resources = engine.hostname_cosmetic_resources("github.com");

let stylesheet = engine.class_id_stylesheet(&["new_class1", "new_class2"], &["new_id1"], resources.exceptions.clone());

I'm noticing now that the signature for Engine::hostname_cosmetic_resources should just be updated to take exceptions by reference instead of by value. Once that's done, you'll even be able to remove the .clone() call.

let resources = engine.hostname_cosmetic_resources("github.com");

let stylesheet = engine.class_id_stylesheet(&["new_class1", "new_class2"], &["new_id1"], &resources.exceptions);

@AndriusA AndriusA merged commit 0933635 into master Jan 2, 2020
@AndriusA AndriusA deleted the extra-cosmetic-filter-docs branch January 2, 2020 11:59
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