mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
reformat the world
This commit is contained in:
parent
5cb1d41a30
commit
12e3b4c70b
129 changed files with 727 additions and 2509 deletions
|
@ -62,10 +62,7 @@ impl StructData {
|
|||
}
|
||||
|
||||
fn variants(enum_def: &ast::EnumDef) -> impl Iterator<Item = &ast::EnumVariant> {
|
||||
enum_def
|
||||
.variant_list()
|
||||
.into_iter()
|
||||
.flat_map(|it| it.variants())
|
||||
enum_def.variant_list().into_iter().flat_map(|it| it.variants())
|
||||
}
|
||||
|
||||
impl EnumVariant {
|
||||
|
@ -83,9 +80,7 @@ impl EnumVariant {
|
|||
(file_id, var)
|
||||
}
|
||||
pub(crate) fn variant_data(&self, db: &impl PersistentHirDatabase) -> Arc<VariantData> {
|
||||
db.enum_data(self.parent).variants[self.id]
|
||||
.variant_data
|
||||
.clone()
|
||||
db.enum_data(self.parent).variants[self.id].variant_data.clone()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -222,14 +217,12 @@ impl StructField {
|
|||
};
|
||||
|
||||
let field_sources = match struct_flavor {
|
||||
ast::StructFlavor::Tuple(fl) => fl
|
||||
.fields()
|
||||
.map(|it| FieldSource::Pos(it.to_owned()))
|
||||
.collect(),
|
||||
ast::StructFlavor::Named(fl) => fl
|
||||
.fields()
|
||||
.map(|it| FieldSource::Named(it.to_owned()))
|
||||
.collect(),
|
||||
ast::StructFlavor::Tuple(fl) => {
|
||||
fl.fields().map(|it| FieldSource::Pos(it.to_owned())).collect()
|
||||
}
|
||||
ast::StructFlavor::Named(fl) => {
|
||||
fl.fields().map(|it| FieldSource::Named(it.to_owned())).collect()
|
||||
}
|
||||
ast::StructFlavor::Unit => Vec::new(),
|
||||
};
|
||||
let field = field_sources
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue