diff --git a/src/main.rs b/src/main.rs index 1ce08a0..d78b29e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -119,7 +119,7 @@ async fn main() -> Result<(), anyhow::Error> { fn parse_remote(remote: &str) -> Result<(String, String), anyhow::Error> { let remote_url = Url::parse(remote).context("can't parse remote")?; - let repo_parts: Vec<&str> = remote_url.path().trim_start_matches("/").split('/').collect(); + let repo_parts: Vec<&str> = remote_url.path().trim_start_matches('/').split('/').collect(); let repo_owner = repo_parts[0].to_string(); let repo_name = repo_parts[1].trim_end_matches(".git").to_string(); @@ -174,6 +174,7 @@ fn find_values_yaml(workspace: String, base: &str, head: &str) -> Result, repo: &mut RepoChangeset) -> Res let associated_prs = associated_prs_page.take_items(); let change_commit = CommitMetadata { - headline: commit.commit.message.split('\n').collect::>()[0].to_string(), + headline: commit + .commit + .message + .split('\n') + .next() + .unwrap_or("") + .to_string(), link: commit.html_url.clone(), };