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
Fix some clippy warnings in components/script/webdriver_handlers.rs
#31784
Conversation
The main branch is ahead of this branch by 3 commits
Hello @mrobinson . I hope you are well. |
@@ -382,10 +382,7 @@ fn get_element_in_view_center_point(element: &Element) -> Option<Point2D<i64>> { | |||
.map(DomRoot::upcast::<Element>) | |||
.and_then(|body| { | |||
element | |||
.GetClientRects() | |||
.iter() | |||
// Step 1 |
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.
This comment refers to first step in spec:
Let rectangle be the first element of the DOMRect sequence returned by calling getClientRects() on element.
so it should be kept.
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.
Thank you @sagudev .
Your response helps a lot.
I'm working on it now.
Hello @mrobinson and @sagudev |
let rectangle_element = element.GetClientRects(); | ||
let rectangle_option = rectangle_element.iter().next(); | ||
rectangle_option.map(|rectangle| { |
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.
I believe that @sagudev meant that you should keep the comment. I recommend something like you had before, just restoring the original comment. We could even improve it a bit:
// Step 1: Let rectangle be the first element of the DOMRect sequence
// returned by calling getClientRects() on element.
element
.GetClientRects().first()
.map(|rectangle| {
I have updated the PR @mrobinson, please review. @mrobinson in the comment; |
This is not necessary. Normal comments aren't processed into rustdoc, so it isn't always useful to make links. In addition, the link exist in the specification that is linked to. I think these links are in @sagudev's comment because they were preserved while copying and pasting from the specification. |
components/script/webdriver_handlers.rs
Fixed some clippy warnings in components/script/webdriver_handlers.rs
./mach build -d
does not report any errors./mach test-tidy
does not report any errors