Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ panic = "warn"
cloned_instead_of_copied = "warn"
implicit_clone = "warn"
needless_pass_by_value = "warn"
redundant_closure_for_method_calls = "warn"

[profile.dist]
inherits = "release"
Expand Down
12 changes: 7 additions & 5 deletions src/api/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use std::time::Duration;
use anyhow::{Context, Result};
use reqwest::header::{HeaderMap, AUTHORIZATION};

use progenitor::progenitor_client::ResponseValue;

use super::types::*;

pub struct ApiClient {
Expand Down Expand Up @@ -38,7 +40,7 @@ impl ApiClient {
self.inner
.get_public_user()
.await
.map(|r| r.into_inner())
.map(ResponseValue::into_inner)
.map_err(|e| anyhow::anyhow!("API error: {}", e))
}

Expand All @@ -59,15 +61,15 @@ impl ApiClient {
status,
)
.await
.map(|r| r.into_inner())
.map(ResponseValue::into_inner)
.map_err(|e| anyhow::anyhow!("API error: {}", e))
}

pub async fn get_bug(&self, bug_id: &BugId) -> Result<Bug> {
self.inner
.get_public_bug(bug_id)
.await
.map(|r| r.into_inner())
.map(ResponseValue::into_inner)
.map_err(|e| anyhow::anyhow!("API error: {}", e))
}

Expand All @@ -87,7 +89,7 @@ impl ApiClient {
self.inner
.create_public_bug_review(bug_id, &body)
.await
.map(|r| r.into_inner())
.map(ResponseValue::into_inner)
.map_err(|e| anyhow::anyhow!("API error: {}", e))
}

Expand All @@ -97,7 +99,7 @@ impl ApiClient {
self.inner
.list_public_repos(NonZeroU64::new(limit.into()), Some(offset.into()))
.await
.map(|r| r.into_inner())
.map(ResponseValue::into_inner)
.map_err(|e| anyhow::anyhow!("API error: {}", e))
}
}
2 changes: 1 addition & 1 deletion src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn version_strings(result: &UpdateResult) -> (String, String) {
let old_version = result
.old_version
.as_ref()
.map(|v| v.to_string())
.map(ToString::to_string)
.unwrap_or_else(|| "unknown".to_string());
let new_version = result.new_version.to_string();
(old_version, new_version)
Expand Down