From a8c260dfa3ccd2fc29928575bee3e82355a782dc Mon Sep 17 00:00:00 2001 From: threema-donat <129288638+threema-donat@users.noreply.github.com> Date: Tue, 14 May 2024 08:02:06 +0200 Subject: [PATCH] Apply suggestions from review --- src/errors.rs | 2 +- src/influxdb.rs | 5 +---- src/push/hms.rs | 2 +- src/server.rs | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index e492024..4f04e7c 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -14,7 +14,7 @@ pub enum PushRelayError { #[error("Reqwest error: {0}")] Reqwest(#[from] ReqwestError), - #[error("{reason}: {source}")] + #[error("I/O error: {reason}: {source}")] IoError { reason: &'static str, source: std::io::Error, diff --git a/src/influxdb.rs b/src/influxdb.rs index db3d8e3..ac98b41 100644 --- a/src/influxdb.rs +++ b/src/influxdb.rs @@ -92,10 +92,7 @@ impl Influxdb { } } - async fn log(&self, body: B) -> InfluxdbResult - where - B: Into, - { + async fn log(&self, body: impl Into) -> InfluxdbResult { let body: Body = body.into(); // Send request diff --git a/src/push/hms.rs b/src/push/hms.rs index 5aa64f0..68f62fa 100644 --- a/src/push/hms.rs +++ b/src/push/hms.rs @@ -42,7 +42,7 @@ pub struct HmsStateConfig { type SharedHmsConfig = Arc; impl HmsStateConfig { - pub fn new() -> SharedHmsConfig { + pub fn new_shared() -> SharedHmsConfig { let login_endpoint = Cow::Borrowed("https://oauth-login.cloud.huawei.com"); let push_endpoint = Cow::Borrowed("https://push-api.cloud.huawei.com"); Arc::new(Self { diff --git a/src/server.rs b/src/server.rs index cd14ef4..fdf2d66 100644 --- a/src/server.rs +++ b/src/server.rs @@ -141,7 +141,7 @@ pub async fn serve( apns_client_prod: apns_client_prod.clone(), apns_client_sbox: apns_client_sbox.clone(), hms_contexts: hms_contexts.clone(), - hms_config: HmsStateConfig::new(), + hms_config: HmsStateConfig::new_shared(), threema_gateway_client: threema_gateway_client.clone(), threema_gateway_private_key: threema_gateway_private_key.clone(), threema_gateway_config: threema_gateway.clone(),