mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Impl HirDisplay
for SelfParam
This commit is contained in:
parent
6918eb6ebd
commit
6a2f83a8a2
2 changed files with 36 additions and 35 deletions
|
@ -2096,14 +2096,6 @@ impl SelfParam {
|
|||
.unwrap_or(Access::Owned)
|
||||
}
|
||||
|
||||
pub fn display(self, db: &dyn HirDatabase) -> &'static str {
|
||||
match self.access(db) {
|
||||
Access::Shared => "&self",
|
||||
Access::Exclusive => "&mut self",
|
||||
Access::Owned => "self",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn source(&self, db: &dyn HirDatabase) -> Option<InFile<ast::SelfParam>> {
|
||||
let InFile { file_id, value } = Function::from(self.func).source(db)?;
|
||||
value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue