Don't return a string from TreeSink::attach_declarative_shadow_root#633
Don't return a string from TreeSink::attach_declarative_shadow_root#633mrobinson merged 2 commits intoservo:mainfrom
TreeSink::attach_declarative_shadow_root#633Conversation
| Err(String::from( | ||
| "No implementation for attach_declarative_shadow", | ||
| )) |
There was a problem hiding this comment.
How about making this &'static str? Then we still get the error message without the allocation.
There was a problem hiding this comment.
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 <simon.wuelker@arcor.de>
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 <simon.wuelker@arcor.de>
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
boolindicating 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).