mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
fix: hide destructure_struct_binding assist if no public fields
This commit is contained in:
parent
9f14343f9e
commit
2a4ba4295b
2 changed files with 23 additions and 9 deletions
|
@ -724,7 +724,10 @@ pub fn record_pat_field_list(
|
|||
) -> ast::RecordPatFieldList {
|
||||
let mut fields = fields.into_iter().join(", ");
|
||||
if let Some(rest_pat) = rest_pat {
|
||||
format_to!(fields, ", {rest_pat}");
|
||||
if !fields.is_empty() {
|
||||
fields.push_str(", ");
|
||||
}
|
||||
format_to!(fields, "{rest_pat}");
|
||||
}
|
||||
ast_from_text(&format!("fn f(S {{ {fields} }}: ()))"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue