Add a serde feature for (de)serializing Selectors#227
Add a serde feature for (de)serializing Selectors#227adamreichold merged 3 commits intorust-scraper:masterfrom jakubslaby09:master
Conversation
|
I think the one thing that is worth discussing here is whether we want to commit to this serialization format when the implementation can be done downstream using existing public API. The CSS representation is obviously somewhat canonical, but there might be a more efficient binary representation? |
|
I feel like the need for a more efficient selector format is rare, so I would provide string serialization as a readable and time-proven default. |
Co-authored-by: Adam Reichold <adamreichold@users.noreply.github.com>
|
Please have a look at the Clippy lint. |
Allow
Selectors to be (de)serialized withserde.This will enable devs who rely on
serdeto use this crate without writing their own wrapper type. One of the use cases is storing selectors in config files when building a program withscraperas a dependency.Parsing errors are handled as custom serde errors