Repository navigation
Remove helper traits - #7401
Remove helper traits#7401
Conversation
|
@nox FYI, in case you missed it, this fails tidy |
There was a problem hiding this comment.
No need for using 'a anywhere in this line (fn foo(&self)->Ref<Bar> will work) because elision.
ditto everywhere else in this PR
|
LGTM, though I'd prefer if elidable things were elided (clears up the code, and makes it easier to sed). I think all lifetime params introduced in this PR can be elided. I may do a more thorough Reviewable review once I have a better viewport, but it otherwise looks good. |
|
I much prefer not eliding lifetimes. |
|
I prefer eliding too, gratuitous tokens that can be inferred don't please me. Will try to sed my way. |
|
Now with elision, scripts in commit messages, and new commits to remove AttributeHandlers. |
|
And finally, tidy not failing. |
|
r+, squash anything if you want to |
|
@bors-servo r+ |
|
📌 Commit c4f7b60 has been approved by |
|
@Ms2ger elision happens in obvious cases (e.g. I really think we should only be eliding when we have to, because it's those cases where the lifetimes are doing something nontrivial and often need to be looked at. Having lifetime params everywhere just makes these cases less prominent. As part of the clippy cleanup I will be moving the rest of Servo to elision (clippy detects areas where the lifetimes are unnecessary), so if we don't want to do that we should discuss it now. |
|
@bors-servo r- |
|
@bors-servo r=Manishearth |
|
📌 Commit c4f7b60 has been approved by |
|
@bors-servo retry |
|
@bors-servo r- |
|
@bors-servo p=1 r+ |
Method get_or_create() is now directly on servohtmlparser::Sink.
On components/script/*.rs:
# Remove imports.
/^ *use dom::element::\{.*AttributeHandlers/ {
s/\{AttributeHandlers, /\{/
s/, AttributeHandlers//g
s/\{([a-zA-Z]+)\}/\1/
/\{\}/d
s/::self;$/;/
}
/^ *use dom::element::\{?AttributeHandlers\}?;$/d
# Remove AttributeHandlers.
/^pub trait AttributeHandlers \{$/,/^\}$/D
# Patch AttributeHandlers methods.
/^impl<'a> AttributeHandlers for &'a Element \{/,/^\}$/ {
s/^impl<'a> AttributeHandlers for &'a Element \{/impl Element {/
/^ *fn /s/\(self([,)])/\(\&self\1/
/^ *fn.*\(&self/s/fn/pub fn/
}
The few error cases were then fixed by hand.
|
@bors-servo r=Manishearth |
|
📌 Commit 2a028f6 has been approved by |
|
Rebased against last master to see if it makes it happy. |
|
@bors-servo r=Manishearth |
|
📌 Commit 2a028f6 has been approved by |
Remove helper traits Now that `JSRef<T>` is gone, there is no need to have helper traits. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7401) <!-- Reviewable:end -->
|
\o/ (also yay, you broke all the PRs) |
Prior to servo#7416 and servo#7401, many of these `impl` sections were not identical
Merge adjacent identical `impl` sections Prior to #7416 and #7401, many of these `impl` sections were not identical <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7431) <!-- Reviewable:end -->
Merge adjacent identical `impl` sections Prior to #7416 and #7401, many of these `impl` sections were not identical <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7431) <!-- Reviewable:end -->
Now that
JSRef<T>is gone, there is no need to have helper traits.