Skip to content

Commit

Permalink
fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
salamaashoush committed Nov 17, 2024
1 parent cbcee11 commit f42830f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/remote_pact_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ pub fn list(repo_url: &str) -> Result<Vec<Release>, Error> {
/// ```rust
/// use crate::remote_pact_index::latest;
/// ```
pub fn latest(repo_url: &String) -> Result<Release, crate::http::Error> {
let index_json_url = format_url(repo_url, "releases/latest");
pub fn latest(repo_url: &str) -> Result<Release, crate::http::Error> {
let base_url = repo_url.trim_end_matches('/');
let index_json_url = format_url(base_url, "releases/latest");
let resp = handle_github_rate_limit(crate::http::get(&index_json_url)?);
let value: Release = resp.json()?;
Ok(value)
Expand All @@ -158,8 +159,9 @@ pub fn latest(repo_url: &String) -> Result<Release, crate::http::Error> {
/// ```rust
/// use crate::remote_pact_index::get_by_tag;
///
pub fn get_by_tag(repo_url: &String, tag: &String) -> Result<Release, crate::http::Error> {
let index_json_url = format_url(repo_url, &format!("releases/tags/{tag}"));
pub fn get_by_tag(repo_url: &str, tag: &String) -> Result<Release, crate::http::Error> {
let base_url = repo_url.trim_end_matches('/');
let index_json_url = format_url(base_url, &format!("releases/tags/{tag}"));
let resp = handle_github_rate_limit(crate::http::get(&index_json_url)?);
let value: Release = resp.json()?;
Ok(value)
Expand Down

0 comments on commit f42830f

Please sign in to comment.