Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bachp committed Sep 23, 2020
1 parent 205a900 commit 5366f36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/provider/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Provider for GitHub {
.get(&url)
.headers(headers)
.send()
.or_else(|e| Err(format!("Unable to connect to: {} ({})", url, e)))?;
.map_err(|e| format!("Unable to connect to: {} ({})", url, e))?;

if res.status() != StatusCode::OK {
if res.status() == StatusCode::UNAUTHORIZED {
Expand All @@ -77,7 +77,7 @@ impl Provider for GitHub {
}

let projects: Vec<Project> = serde_json::from_reader(res)
.or_else(|e| Err(format!("Unable to parse response as JSON ({:?})", e)))?;
.map_err(|e| format!("Unable to parse response as JSON ({:?})", e))?;

let mut mirrors: Vec<MirrorResult> = Vec::new();

Expand Down
4 changes: 2 additions & 2 deletions src/provider/gitlab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl GitLab {
.get(&url)
.headers(headers.clone())
.send()
.or_else(|e| Err(format!("Unable to connect to: {} ({})", url, e)))?;
.map_err(|e| format!("Unable to connect to: {} ({})", url, e))?;

debug!("HTTP Status Received: {}", res.status());

Expand Down Expand Up @@ -99,7 +99,7 @@ impl GitLab {
};

let results_page: Vec<T> = serde_json::from_reader(res)
.or_else(|e| Err(format!("Unable to parse response as JSON ({})", e)))?;
.map_err(|e| format!("Unable to parse response as JSON ({})", e))?;

results.extend(results_page);

Expand Down

0 comments on commit 5366f36

Please sign in to comment.