diff options
| author | Caleb Cartwright <caleb.cartwright@outlook.com> | 2021-01-12 17:40:53 -0600 |
|---|---|---|
| committer | Caleb Cartwright <calebcartwright@users.noreply.github.com> | 2021-01-16 11:17:23 -0600 |
| commit | c4d551cdf57bd7041ed95c81f10daee158a1fc7f (patch) | |
| tree | ef568e7d420bef2b36e512ee70f0dd60d191c5e1 | |
| parent | b30cb2428652a43bba58ef190d9915c6a305c1ae (diff) | |
| download | rust-c4d551cdf57bd7041ed95c81f10daee158a1fc7f.tar.gz rust-c4d551cdf57bd7041ed95c81f10daee158a1fc7f.zip | |
refactor: remove unneeded clone
| -rw-r--r-- | src/types.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/types.rs b/src/types.rs index 7ef0c39d578..cda17e13eeb 100644 --- a/src/types.rs +++ b/src/types.rs @@ -967,22 +967,21 @@ fn join_bounds_inner( joiner }; - let (trailing_str, extendable) = if i == 0 { + let (extendable, trailing_str) = if i == 0 { let bound_str = item.rewrite(context, shape)?; - let bound_str_clone = bound_str.clone(); - (bound_str, is_bound_extendable(&bound_str_clone, item)) + (is_bound_extendable(&bound_str, item), bound_str) } else { let bound_str = &item.rewrite(context, shape)?; match leading_span { Some(ls) if has_leading_comment => ( + is_bound_extendable(bound_str, item), combine_strs_with_missing_comments( context, joiner, bound_str, ls, shape, true, )?, - is_bound_extendable(bound_str, item), ), _ => ( - String::from(joiner) + bound_str, is_bound_extendable(bound_str, item), + String::from(joiner) + bound_str, ), } }; |
