8110: simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2021-03-19 18:01:34 +00:00 committed by GitHub
commit 0392e63c95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -50,8 +50,8 @@ pub(crate) fn move_bounds_to_where_clause(acc: &mut Assists, ctx: &AssistContext
for type_param in type_param_list.type_params() {
if let Some(tbl) = type_param.type_bound_list() {
if let Some(predicate) = build_predicate(type_param.clone()) {
where_clause.add_predicate(predicate.clone_for_update())
if let Some(predicate) = build_predicate(type_param) {
where_clause.add_predicate(predicate)
}
tbl.remove()
}
@ -69,7 +69,7 @@ fn build_predicate(param: ast::TypeParam) -> Option<ast::WherePred> {
make::path_unqualified(segment)
};
let predicate = make::where_pred(path, param.type_bound_list()?.bounds());
Some(predicate)
Some(predicate.clone_for_update())
}
#[cfg(test)]