Open
Description
Hi, I has been using this library from a while, has been great.
Here a example:
fn a(document: &Html) -> Result<(), Box<dyn Error>> {
let query = format!("div table thead tr:nth-child({}) th", 3);
let selector = Selector::parse(&query)?;
Ok(())
}
This function will fails, the reason is pretty simple, the function owns the query, but the error triggered by parse seems to have borrowed the string, so it can't return an error when the function owns the data.
The workaround right now is unwrap instead use error propagation.
There is some ways to handle this, one would be a parse with String which owns the data, other one is instead use a borrowed string for the error, convert &str to String and use that instead.
Thx!