mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
reformat the world
This commit is contained in:
parent
5cb1d41a30
commit
12e3b4c70b
129 changed files with 727 additions and 2509 deletions
|
@ -50,17 +50,11 @@ impl ImplBlock {
|
|||
item: ImplItem,
|
||||
) -> Option<ImplBlock> {
|
||||
let impl_id = *module_impl_blocks.impls_by_def.get(&item)?;
|
||||
Some(ImplBlock {
|
||||
module_impl_blocks,
|
||||
impl_id,
|
||||
})
|
||||
Some(ImplBlock { module_impl_blocks, impl_id })
|
||||
}
|
||||
|
||||
pub(crate) fn from_id(module_impl_blocks: Arc<ModuleImplBlocks>, impl_id: ImplId) -> ImplBlock {
|
||||
ImplBlock {
|
||||
module_impl_blocks,
|
||||
impl_id,
|
||||
}
|
||||
ImplBlock { module_impl_blocks, impl_id }
|
||||
}
|
||||
|
||||
pub fn id(&self) -> ImplId {
|
||||
|
@ -144,11 +138,7 @@ impl ImplData {
|
|||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
ImplData {
|
||||
target_trait,
|
||||
target_type,
|
||||
items,
|
||||
}
|
||||
ImplData { target_trait, target_type, items }
|
||||
}
|
||||
|
||||
pub fn target_trait(&self) -> Option<&TypeRef> {
|
||||
|
@ -212,10 +202,9 @@ impl ModuleImplBlocks {
|
|||
let file_id: HirFileId = file_id.into();
|
||||
let node = match &module_source {
|
||||
ModuleSource::SourceFile(node) => node.syntax(),
|
||||
ModuleSource::Module(node) => node
|
||||
.item_list()
|
||||
.expect("inline module should have item list")
|
||||
.syntax(),
|
||||
ModuleSource::Module(node) => {
|
||||
node.item_list().expect("inline module should have item list").syntax()
|
||||
}
|
||||
};
|
||||
|
||||
for impl_block_ast in node.children().filter_map(ast::ImplBlock::cast) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue