-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Labels
C-feature-requestCategory: feature requestCategory: feature requestC-help-wantedCategory: help wantedCategory: help wanted
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!
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: feature requestCategory: feature requestC-help-wantedCategory: help wantedCategory: help wanted