@@ -12,7 +12,7 @@ use crate::clean::types::{
1212use crate :: formats:: cache:: Cache ;
1313use crate :: formats:: item_type:: ItemType ;
1414use crate :: html:: markdown:: short_markdown_summary;
15- use crate :: html:: render:: { Generic , IndexItem , IndexItemFunctionType , RenderType , TypeWithKind } ;
15+ use crate :: html:: render:: { IndexItem , IndexItemFunctionType , RenderType , TypeWithKind } ;
1616
1717/// Indicates where an external crate can be found.
1818crate enum ExternalLocation {
@@ -44,7 +44,7 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
4444 desc,
4545 parent : Some ( did. into ( ) ) ,
4646 parent_idx : None ,
47- search_type : get_index_search_type ( & item, cache , tcx) ,
47+ search_type : get_index_search_type ( & item, tcx) ,
4848 aliases : item. attrs . get_doc_aliases ( ) ,
4949 } ) ;
5050 }
@@ -192,7 +192,6 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
192192
193193crate fn get_index_search_type < ' tcx > (
194194 item : & clean:: Item ,
195- cache : & Cache ,
196195 tcx : TyCtxt < ' tcx > ,
197196) -> Option < IndexItemFunctionType > {
198197 let ( all_types, ret_types) = match * item. kind {
@@ -204,25 +203,22 @@ crate fn get_index_search_type<'tcx>(
204203
205204 let inputs = all_types
206205 . iter ( )
207- . map ( |( ty, kind) | TypeWithKind :: from ( ( get_index_type ( & ty, & cache ) , * kind) ) )
206+ . map ( |( ty, kind) | TypeWithKind :: from ( ( get_index_type ( & ty) , * kind) ) )
208207 . filter ( |a| a. ty . name . is_some ( ) )
209208 . collect ( ) ;
210209 let output = ret_types
211210 . iter ( )
212- . map ( |( ty, kind) | TypeWithKind :: from ( ( get_index_type ( & ty, & cache ) , * kind) ) )
211+ . map ( |( ty, kind) | TypeWithKind :: from ( ( get_index_type ( & ty) , * kind) ) )
213212 . filter ( |a| a. ty . name . is_some ( ) )
214213 . collect :: < Vec < _ > > ( ) ;
215214 let output = if output. is_empty ( ) { None } else { Some ( output) } ;
216215
217216 Some ( IndexItemFunctionType { inputs, output } )
218217}
219218
220- fn get_index_type ( clean_type : & clean:: Type , cache : & Cache ) -> RenderType {
219+ fn get_index_type ( clean_type : & clean:: Type ) -> RenderType {
221220 RenderType {
222- ty : clean_type. def_id_full ( cache) ,
223- idx : None ,
224221 name : get_index_type_name ( clean_type, true ) . map ( |s| s. as_str ( ) . to_ascii_lowercase ( ) ) ,
225- generics : get_generics ( clean_type, cache) ,
226222 }
227223}
228224
@@ -254,22 +250,6 @@ fn get_index_type_name(clean_type: &clean::Type, accept_generic: bool) -> Option
254250 }
255251}
256252
257- fn get_generics ( clean_type : & clean:: Type , cache : & Cache ) -> Option < Vec < Generic > > {
258- clean_type. generics ( ) . and_then ( |types| {
259- let r = types
260- . iter ( )
261- . filter_map ( |t| {
262- get_index_type_name ( t, false ) . map ( |name| Generic {
263- name : name. as_str ( ) . to_ascii_lowercase ( ) ,
264- defid : t. def_id_full ( cache) ,
265- idx : None ,
266- } )
267- } )
268- . collect :: < Vec < _ > > ( ) ;
269- if r. is_empty ( ) { None } else { Some ( r) }
270- } )
271- }
272-
273253/// The point of this function is to replace bounds with types.
274254///
275255/// i.e. `[T, U]` when you have the following bounds: `T: Display, U: Option<T>` will return
0 commit comments