Skip to content

Commit 9a59774

Browse files
committed
Remove some code.
It's just replicating exactly what is done by `<Vec<GenericParamDef> as FromClean>::into_json`
1 parent 4736142 commit 9a59774

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

src/librustdoc/json/conversions.rs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -423,38 +423,7 @@ impl FromClean<clean::WherePredicate> for WherePredicate {
423423
BoundPredicate { ty, bounds, bound_params } => WherePredicate::BoundPredicate {
424424
type_: ty.into_json(renderer),
425425
bounds: bounds.into_json(renderer),
426-
generic_params: bound_params
427-
.iter()
428-
.map(|x| {
429-
let name = x.name.to_string();
430-
let kind = match &x.kind {
431-
clean::GenericParamDefKind::Lifetime { outlives } => {
432-
GenericParamDefKind::Lifetime {
433-
outlives: outlives.iter().map(|lt| lt.0.to_string()).collect(),
434-
}
435-
}
436-
clean::GenericParamDefKind::Type { bounds, default, synthetic } => {
437-
GenericParamDefKind::Type {
438-
bounds: bounds
439-
.into_iter()
440-
.map(|bound| bound.into_json(renderer))
441-
.collect(),
442-
default: default
443-
.as_ref()
444-
.map(|ty| ty.as_ref().into_json(renderer)),
445-
is_synthetic: *synthetic,
446-
}
447-
}
448-
clean::GenericParamDefKind::Const { ty, default, synthetic: _ } => {
449-
GenericParamDefKind::Const {
450-
type_: ty.as_ref().into_json(renderer),
451-
default: default.as_ref().map(|d| d.as_ref().clone()),
452-
}
453-
}
454-
};
455-
GenericParamDef { name, kind }
456-
})
457-
.collect(),
426+
generic_params: bound_params.into_json(renderer),
458427
},
459428
RegionPredicate { lifetime, bounds } => WherePredicate::LifetimePredicate {
460429
lifetime: convert_lifetime(lifetime),

0 commit comments

Comments
 (0)