633: use ToOwned trait instead of inherent method r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2019-01-24 23:10:09 +00:00
commit 1d4b421aad
4 changed files with 523 additions and 8 deletions

File diff suppressed because it is too large Load diff

View file

@ -48,6 +48,10 @@ impl AstNode for {{ node }} {
}
}
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl ToOwned for {{ node }} {
type Owned = TreeArc<{{ node }}>;
fn to_owned(&self) -> TreeArc<{{ node }}> { TreeArc::cast(self.syntax.to_owned()) }
}
@ -79,6 +83,10 @@ impl AstNode for {{ node }} {
}
}
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl ToOwned for {{ node }} {
type Owned = TreeArc<{{ node }}>;
fn to_owned(&self) -> TreeArc<{{ node }}> { TreeArc::cast(self.syntax.to_owned()) }
}