mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-18 16:20:18 +00:00
complete struct literals
This commit is contained in:
parent
666303faf3
commit
65a2be4953
4 changed files with 78 additions and 0 deletions
|
@ -724,6 +724,12 @@ impl LiteralExpr {
|
|||
}
|
||||
}
|
||||
|
||||
impl NamedField {
|
||||
pub fn parent_struct_lit(&self) -> &StructLit {
|
||||
self.syntax().ancestors().find_map(StructLit::cast).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl BindPat {
|
||||
pub fn is_mutable(&self) -> bool {
|
||||
self.syntax().children().any(|n| n.kind() == MUT_KW)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue