From 5e9d9f79816b0d18e280eeb991957ebb31f5328b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 15 Aug 2024 13:53:34 +0200 Subject: [PATCH] Simplify iter, add todo --- src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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(), };