-
Notifications
You must be signed in to change notification settings - Fork 243
Don't return a string from TreeSink::attach_declarative_shadow_root
#633
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
Conversation
Err(String::from( | ||
"No implementation for attach_declarative_shadow", | ||
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about making this &'static str
? Then we still get the error message without the allocation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the string is discarded anyways. html5ever
doesn't care why attaching the shadow root failed - maybe the element already is a shadow host, maybe the element is not in the html namespace. This message is not logged anywhere, and I don't think it needs to be either.
Signed-off-by: Simon Wülker <[email protected]>
34a021a
to
37ca1e4
Compare
This now includes a commit to bump html5ever to 0.34. The version bump is necessary because this is a breaking change. There is a passing try run in servo/servo#37736. Can someone with release merge permissions merge this and release to crates.io? |
fa99df8
to
2a84b3d
Compare
Signed-off-by: Simon Wülker <[email protected]>
2a84b3d
to
71185cb
Compare
0.34 still needs to be published. |
I tried publishing today, but I got this error. Sorry, I haven't had time to get to the bottom of it:
|
This requires a major version update for markup5ever as well, since the public interface changed. |
Oops, my bad. I opened #636 to bump markup5ever as well. |
The string is unused, so this is just a pointless allocation. This change returns a
bool
indicating the operations success instead.Additionally, pass a reference to the elements attributes. The callee can decide whether they need ownership of the vector or not (servo doesn't).