Skip to content

Commit

Permalink
refactor: remove unneeded clone
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Jan 13, 2021
1 parent d545261 commit a97fd77
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/formatting/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -964,22 +964,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,
),
}
};
Expand Down

0 comments on commit a97fd77

Please sign in to comment.