mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove doublepointer in VirtualMethods, and from_borrowed_ref
Most of the heavy lifting done by: ``` $ ls *rs | xargs gawk -i inplace '/let .*: &&.*from_borrowed_ref/{sub("&&", "\\&");sub("_borrowed_","_");} {print $0}' $ ls *rs | xargs gawk -i inplace "/impl.*VirtualMethods/{in_vm=1; sub(/<'a>/,\"\");sub(/&'a /,\"\")} /^}\$/{in_vm=0;} in_vm{\$0=gensub(/\\*self([^.])/,\"self\\\1\",\"g\"); sub(/from_borrowed_ref/,\"from_ref\")} {print}" ```
This commit is contained in:
parent
5e83a3f0a3
commit
b33c5427bc
34 changed files with 159 additions and 164 deletions
|
@ -70,9 +70,9 @@ impl<'a> HTMLTitleElementMethods for &'a HTMLTitleElement {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> VirtualMethods for &'a HTMLTitleElement {
|
||||
impl VirtualMethods for HTMLTitleElement {
|
||||
fn super_type<'b>(&'b self) -> Option<&'b VirtualMethods> {
|
||||
let htmlelement: &&HTMLElement = HTMLElementCast::from_borrowed_ref(self);
|
||||
let htmlelement: &HTMLElement = HTMLElementCast::from_ref(self);
|
||||
Some(htmlelement as &VirtualMethods)
|
||||
}
|
||||
|
||||
|
@ -80,14 +80,14 @@ impl<'a> VirtualMethods for &'a HTMLTitleElement {
|
|||
if let Some(ref s) = self.super_type() {
|
||||
s.children_changed(mutation);
|
||||
}
|
||||
let node = NodeCast::from_ref(*self);
|
||||
let node = NodeCast::from_ref(self);
|
||||
if node.is_in_doc() {
|
||||
node.owner_doc().title_changed();
|
||||
}
|
||||
}
|
||||
|
||||
fn bind_to_tree(&self, is_in_doc: bool) {
|
||||
let node = NodeCast::from_ref(*self);
|
||||
let node = NodeCast::from_ref(self);
|
||||
if is_in_doc {
|
||||
let document = node.owner_doc();
|
||||
document.r().title_changed();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue