mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-31 12:04:43 +00:00 
			
		
		
		
	Auto merge of #16525 - Veykril:item-loc, r=Veykril
Abstract more over ItemTreeLoc-like structs Allows reducing some code duplication by using functions generic over said structs. The diff isn't negative due to me adding some additional impls for completeness.
This commit is contained in:
		
						commit
						1ef7a2329b
					
				
					 28 changed files with 409 additions and 413 deletions
				
			
		|  | @ -75,7 +75,7 @@ fn render( | |||
|     let ret_type = func.ret_type(db); | ||||
|     let assoc_item = func.as_assoc_item(db); | ||||
| 
 | ||||
|     let trait_ = assoc_item.and_then(|trait_| trait_.containing_trait_or_trait_impl(db)); | ||||
|     let trait_ = assoc_item.and_then(|trait_| trait_.container_or_implemented_trait(db)); | ||||
|     let is_op_method = trait_.map_or(false, |trait_| completion.is_ops_trait(trait_)); | ||||
| 
 | ||||
|     let is_item_from_notable_trait = | ||||
|  | @ -145,7 +145,7 @@ fn render( | |||
|         } | ||||
|         None => { | ||||
|             if let Some(actm) = assoc_item { | ||||
|                 if let Some(trt) = actm.containing_trait_or_trait_impl(db) { | ||||
|                 if let Some(trt) = actm.container_or_implemented_trait(db) { | ||||
|                     item.trait_name(trt.name(db).to_smol_str()); | ||||
|                 } | ||||
|             } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bors
						bors