Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upscript::dom::servoparser::async_html::Tokenizer uses Err for a non-errror condition #25516
Comments
|
I would like to refactor this. Is there any particular reason why an Option here would be undesirable? Also, the feed function in html.rs has the same return type. Should I refactor that as well? |
|
I suspect that Result was used for the benefit of the |
|
Got it. And are there any relevant tests for the servoparser? Or would a successful build be sufficient? |
|
A successful build will be sufficient. |
This functionally works, but it's misleading:
servo/components/script/dom/servoparser/async_html.rs
Line 268 in ce6204b
Returning an HTMLScriptElement is just a normal case here, not an error condition. If
Option<DomRoot<HTMLScriptElement>>is undesirable, an enum would be more appropriate than using Result in this way.