mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
use ToOwned trait instead of inherent method
This commit is contained in:
parent
b308375b82
commit
2e354f480b
4 changed files with 523 additions and 8 deletions
|
@ -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()) }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue