Remove some unnecessarily verbose code
This commit is contained in:
parent
fa3eebb26e
commit
8bee2b88c0
@ -609,28 +609,13 @@ impl<'a> TraitDef<'a> {
|
|||||||
|
|
||||||
// and similarly for where clauses
|
// and similarly for where clauses
|
||||||
where_clause.predicates.extend(generics.where_clause.predicates.iter().map(|clause| {
|
where_clause.predicates.extend(generics.where_clause.predicates.iter().map(|clause| {
|
||||||
match *clause {
|
match clause {
|
||||||
ast::WherePredicate::BoundPredicate(ref wb) => {
|
ast::WherePredicate::BoundPredicate(_)
|
||||||
ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate {
|
| ast::WherePredicate::RegionPredicate(_) => clause.clone(),
|
||||||
span: wb.span,
|
ast::WherePredicate::EqPredicate(we) => {
|
||||||
bound_generic_params: wb.bound_generic_params.clone(),
|
|
||||||
bounded_ty: wb.bounded_ty.clone(),
|
|
||||||
bounds: wb.bounds.to_vec(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
ast::WherePredicate::RegionPredicate(ref rb) => {
|
|
||||||
ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate {
|
|
||||||
span: rb.span,
|
|
||||||
lifetime: rb.lifetime,
|
|
||||||
bounds: rb.bounds.to_vec(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
ast::WherePredicate::EqPredicate(ref we) => {
|
|
||||||
ast::WherePredicate::EqPredicate(ast::WhereEqPredicate {
|
ast::WherePredicate::EqPredicate(ast::WhereEqPredicate {
|
||||||
id: ast::DUMMY_NODE_ID,
|
id: ast::DUMMY_NODE_ID,
|
||||||
span: we.span,
|
..we.clone()
|
||||||
lhs_ty: we.lhs_ty.clone(),
|
|
||||||
rhs_ty: we.rhs_ty.clone(),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user