You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use scraper::Selector;#[tokio::main]asyncfnmain() -> anyhow::Result<()>{let selector = Selector::parse("#top")?;Ok(())}
The text was updated successfully, but these errors were encountered:
jlaffaye
changed the title
SelectorErrorKind usage of NonNull/Rc<String> makes it non Send
Token usage of CowRcStr and NonNull/Rc<String> makes it non Send
Nov 30, 2023
I just noticed this too today in a project of mine, and as a quick hack (since I don't care that much about the error case right now), used a workaround for now
let row_selector = Selector::parse("tr.am-grid-row").map_err(|k| anyhow!(k.to_string()))?;
So the issue is that errors have CowRcStrs, right? I don't think we really want to turn such thing into something that's Send, it's very intentional to avoid performance overhead.
Is there a way of telling anyhow or such to turn the error into Send-able error easily? If so we could put such code behind a feature gate without much trouble. But yeah making Token in particular use atomic operations when not needed is probably a no-go.
And it is required by anyhow in async functions.
To reproduce, try to compile this code
The text was updated successfully, but these errors were encountered: