From 5366f36ddc96a4c806f5857ecc007e0e923a2d89 Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Wed, 23 Sep 2020 11:54:09 +0200 Subject: [PATCH] fix clippy warnings --- src/provider/github.rs | 4 ++-- src/provider/gitlab.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/provider/github.rs b/src/provider/github.rs index e5da055..4b78af1 100644 --- a/src/provider/github.rs +++ b/src/provider/github.rs @@ -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 { @@ -77,7 +77,7 @@ impl Provider for GitHub { } let projects: Vec = 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 = Vec::new(); diff --git a/src/provider/gitlab.rs b/src/provider/gitlab.rs index f8f52a3..7d02a9b 100644 --- a/src/provider/gitlab.rs +++ b/src/provider/gitlab.rs @@ -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()); @@ -99,7 +99,7 @@ impl GitLab { }; let results_page: Vec = 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);