-
Notifications
You must be signed in to change notification settings - Fork 136
PasrseError and error Trait #247
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
Comments
I don’t think there’s a reason not to have that impl, it’s just that nobody bothered to add it so far. I personally find the That said, I’d accept a PR to add impls of |
Hi, Your right that it does not need to implement the I'll checkout the cssparser code and add the Error trait and see if I can get that working and then I'll send off the PR. |
Please add the impl of |
@Boscop #247 (comment) pointed out that Error is not needed for ? to work. |
@jdm Yes but it requires a custom error type and a |
Even with a custom So it could be improved by implementing |
What do you mean by that? This library mostly only knows about tokens, not CSS Selectors. |
@SimonSapin Sorry, I'm using So please ignore that point. The others are still valid though :) |
Why can't you just use |
Previously the `ParseError` struct did not implement `std::error::Error` or `std::fmt::Display`. This meant that `ParseError` was not boxable into an "any error" box like `anyhow::Error`. This commit adds Error and Display implementations for ParseError and friends. Fixes #247
Hi,
I was wondering why the ParseError struct does not implement the std::error::Error trait? I was hoping to wrap it in a custom error enum type and use the "?" operator when calling parse functions. From what I've tried so far has not allowed me to do so.
The text was updated successfully, but these errors were encountered: