Skip to content

Commit c4d551c

Browse files
refactor: remove unneeded clone
1 parent b30cb24 commit c4d551c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: src/types.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -967,22 +967,21 @@ fn join_bounds_inner(
967967
joiner
968968
};
969969

970-
let (trailing_str, extendable) = if i == 0 {
970+
let (extendable, trailing_str) = if i == 0 {
971971
let bound_str = item.rewrite(context, shape)?;
972-
let bound_str_clone = bound_str.clone();
973-
(bound_str, is_bound_extendable(&bound_str_clone, item))
972+
(is_bound_extendable(&bound_str, item), bound_str)
974973
} else {
975974
let bound_str = &item.rewrite(context, shape)?;
976975
match leading_span {
977976
Some(ls) if has_leading_comment => (
977+
is_bound_extendable(bound_str, item),
978978
combine_strs_with_missing_comments(
979979
context, joiner, bound_str, ls, shape, true,
980980
)?,
981-
is_bound_extendable(bound_str, item),
982981
),
983982
_ => (
984-
String::from(joiner) + bound_str,
985983
is_bound_extendable(bound_str, item),
984+
String::from(joiner) + bound_str,
986985
),
987986
}
988987
};

0 commit comments

Comments
 (0)