Skip to content

Commit

Permalink
Apply suggestions from review
Browse files Browse the repository at this point in the history
  • Loading branch information
threema-donat committed May 14, 2024
1 parent f36f925 commit 6f96377
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn make_client(pool_idle_timeout_seconds: u64) -> Result<Client, Error> {
.pool_idle_timeout(Duration::from_secs(pool_idle_timeout_seconds))
.http1_only()
.use_rustls_tls()
.https_only(false)
.tls_built_in_root_certs(true)
.https_only(!cfg!(test))
.tls_built_in_native_certs(true)
.build()
}
5 changes: 1 addition & 4 deletions src/influxdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ impl Influxdb {
}
}

async fn log<B>(&self, body: B) -> InfluxdbResult
where
B: Into<Body>,
{
async fn log(&self, body: impl Into<Body>) -> InfluxdbResult {
let body: Body = body.into();

// Send request
Expand Down
2 changes: 1 addition & 1 deletion src/push/hms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub struct HmsStateConfig {
type SharedHmsConfig = Arc<HmsStateConfig>;

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 {
Expand Down
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 6f96377

Please sign in to comment.