fn add_deref_target(
        map: &FxHashMap<DefId, &Type>,
        cleaner: &mut BadImplStripper,
        type_did: &DefId,
    ) {
        if let Some(target) = map.get(type_did) {
            debug!("add_deref_target: type {:?}, target {:?}", type_did, target);
            if let Some(target_prim) = target.primitive_type() {
                cleaner.prims.insert(target_prim);
            } else if let Some(target_did) = target.def_id() {
                // `impl Deref<Target = S> for S`
                if target_did == *type_did {
                    // Avoid infinite cycles
                    return;
                }
                cleaner.items.insert(target_did);
                add_deref_target(map, cleaner, &target_did);
            }
        }
    }
// Follow all `Deref` targets of included items and recursively add them as valid
Follow all `Deref` targets of included items and recursively add them as valid
Follow all ` Deref ` targets of included items and recursively add them as valid
fn add_deref_target(
        map: &FxHashMap<DefId, &Type>,
        cleaner: &mut BadImplStripper,
        type_did: &DefId,
    ) {
        if let Some(target) = map.get(type_did) {
            debug!("add_deref_target: type {:?}, target {:?}", type_did, target);
            if let Some(target_prim) = target.primitive_type() {
                cleaner.prims.insert(target_prim);
            } else if let Some(target_did) = target.def_id() {
                // `impl Deref<Target = S> for S`
                if target_did == *type_did {
                    // Avoid infinite cycles
                    return;
                }
                cleaner.items.insert(target_did);
                add_deref_target(map, cleaner, &target_did);
            }
        }
    }
fn add_deref_target ( map : & FxHashMap < DefId , & Type > , cleaner : & mut BadImplStripper , type_did : & DefId , ) { if let Some ( target ) = map . get ( type_did ) { debug ! ( " " type_did target ) ; if let Some ( target_prim ) = target . primitive_type ( ) { cleaner . prims . insert ( target_prim ) ; } else if let Some ( target_did ) = target . def_id ( ) { // `impl Deref<Target = S> for S` if target_did == * type_did { // Avoid infinite cycles return ; } cleaner . items . insert ( target_did ) ; add_deref_target ( map , cleaner , & target_did ) ; } } }
Follow all `Deref` targets of included items and recursively add them as valid
Follow all ` Deref ` targets of included items and recursively add them as valid
map
&FxHashMap<DefId, &Type>
cleaner
&mut BadImplStripper
type_did
&DefId