Skip to content

Commit 7520d22

Browse files
committed
cleanup: suppress clippy format-collect warnings
Although the suggestion of using `fold` and `write!` is indeed more efficient, it's harder to read and write, and these code paths are not performance-sensitive. There's also a fix where we `flat_map` and yield all of the string components in a fixed-size array, but it's hard to read.
1 parent 5af43ab commit 7520d22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

git-branchless-lib/src/core/rewrite/execute.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ pub fn move_branches<'a>(
143143
}
144144
}
145145

146+
#[allow(clippy::format_collect)]
146147
let branch_moves_stdin: String = branch_moves
147148
.into_iter()
148149
.map(|(old_oid, new_oid, name)| {
@@ -929,6 +930,7 @@ mod in_memory {
929930

930931
// Call the `post-rewrite` hook only after moving branches so that we don't
931932
// produce a spurious abandoned-branch warning.
933+
#[allow(clippy::format_collect)]
932934
let post_rewrite_stdin: String = rewritten_oids
933935
.iter()
934936
.map(|(old_oid, new_oid)| format!("{old_oid} {new_oid}\n"))
@@ -1095,6 +1097,7 @@ mod on_disk {
10951097
}
10961098

10971099
let todo_file_path = rebase_state_dir.join("git-rebase-todo");
1100+
#[allow(clippy::format_collect)]
10981101
std::fs::write(
10991102
&todo_file_path,
11001103
rebase_plan

0 commit comments

Comments
 (0)