Skip to content

Commit a97fd77

Browse files
refactor: remove unneeded clone
1 parent d545261 commit a97fd77

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: src/formatting/types.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -964,22 +964,21 @@ fn join_bounds_inner(
964964
joiner
965965
};
966966

967-
let (trailing_str, extendable) = if i == 0 {
967+
let (extendable, trailing_str) = if i == 0 {
968968
let bound_str = item.rewrite(context, shape)?;
969-
let bound_str_clone = bound_str.clone();
970-
(bound_str, is_bound_extendable(&bound_str_clone, item))
969+
(is_bound_extendable(&bound_str, item), bound_str)
971970
} else {
972971
let bound_str = &item.rewrite(context, shape)?;
973972
match leading_span {
974973
Some(ls) if has_leading_comment => (
974+
is_bound_extendable(bound_str, item),
975975
combine_strs_with_missing_comments(
976976
context, joiner, bound_str, ls, shape, true,
977977
)?,
978-
is_bound_extendable(bound_str, item),
979978
),
980979
_ => (
981-
String::from(joiner) + bound_str,
982980
is_bound_extendable(bound_str, item),
981+
String::from(joiner) + bound_str,
983982
),
984983
}
985984
};

0 commit comments

Comments
 (0)