mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Refactor away duplication of get_rooted functionality
Refactor .get().map(Root::from_rooted) and .get().map(|foo| foo.root()) to .get_rooted() on MutNullableHeap objects. First part done mechanically with the following comand: sed -i s/"get().map(Root::from_rooted)"/"get_rooted()"/g *.rs Second part done manually after finding them with git grep ".get().map(" Fixes 7929.
This commit is contained in:
parent
ab42ca4296
commit
8b5fe88bd3
9 changed files with 24 additions and 24 deletions
|
@ -189,12 +189,12 @@ impl EventMethods for Event {
|
|||
|
||||
// https://dom.spec.whatwg.org/#dom-event-target
|
||||
fn GetTarget(&self) -> Option<Root<EventTarget>> {
|
||||
self.target.get().map(Root::from_rooted)
|
||||
self.target.get_rooted()
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-event-currenttarget
|
||||
fn GetCurrentTarget(&self) -> Option<Root<EventTarget>> {
|
||||
self.current_target.get().map(Root::from_rooted)
|
||||
self.current_target.get_rooted()
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-event-defaultprevented
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue