Skip to content

Commit b826af7

Browse files
fixup! test(ci): add changelog job that runs cargo xtask changelog
1 parent 885dad2 commit b826af7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

xtask/src/changelog.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ fn hunks_in_a_released_section<'a>(changelog_contents: &str, diff: &'a str) -> V
9696
+ changelog_lines.position(|l| l.starts_with("## ")).unwrap() as u64;
9797

9898
let hunks = {
99-
let first_hunk_idx = diff.match_indices("\n@@").next().unwrap().0;
99+
let first_hunk_match = diff.match_indices("\n@@").next();
100+
let Some((first_hunk_idx, _)) = first_hunk_match else {
101+
log::info!("no diff found");
102+
return vec![];
103+
};
100104
SplitPrefixInclusive::new("\n@@", &diff[first_hunk_idx..]).map(|s| &s['\n'.len_utf8()..])
101105
};
102106
let hunks_in_a_released_section = hunks

0 commit comments

Comments
 (0)