mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-30 23:27:24 +00:00
Don't use an untyped String for ActiveParam tracking
This commit is contained in:
parent
5cc8ad0c4a
commit
38048c35d8
5 changed files with 44 additions and 24 deletions
|
@ -380,6 +380,15 @@ impl fmt::Display for NameOrNameRef {
|
|||
}
|
||||
}
|
||||
|
||||
impl NameOrNameRef {
|
||||
pub fn text(&self) -> &str {
|
||||
match self {
|
||||
NameOrNameRef::Name(name) => name.text(),
|
||||
NameOrNameRef::NameRef(name_ref) => name_ref.text(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::RecordPatField {
|
||||
pub fn for_field_name_ref(field_name: &ast::NameRef) -> Option<ast::RecordPatField> {
|
||||
let candidate = field_name.syntax().parent().and_then(ast::RecordPatField::cast)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue