From af7e84cf1e142f4a0fc761f864c0e97410edda4e Mon Sep 17 00:00:00 2001 From: o2sh Date: Sat, 25 Jan 2025 23:33:36 +0100 Subject: [PATCH] review --- src/info/url.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/info/url.rs b/src/info/url.rs index 89678462a..54f57562f 100644 --- a/src/info/url.rs +++ b/src/info/url.rs @@ -23,11 +23,11 @@ pub fn get_repo_url(repo: &Repository, hide_token: bool, http_url: bool) -> Resu None => return Ok(String::new()), }; - if let Some(url) = remote.url(gix::remote::Direction::Push) { - Ok(format_url(&url.to_string(), hide_token, http_url)) - } else { - Ok(String::new()) - } + Ok(remote + .url(gix::remote::Direction::Push) + .map(|url| format_url(&url.to_string(), hide_token, http_url)) + .unwrap_or_default()) + } fn format_url(url: &str, hide_token: bool, http_url: bool) -> String {