diff --git a/src/account_manager.rs b/src/account_manager.rs index f3d4301ee..9e69aaccb 100644 --- a/src/account_manager.rs +++ b/src/account_manager.rs @@ -255,7 +255,7 @@ impl AccountManager { .request( Method::PUT, Endpoint::Service, - &format!("/v1/provisioning/{}", destination), + format!("/v1/provisioning/{}", destination), HttpAuthOverride::NoOverride, )? .json(&ProvisioningMessage { diff --git a/src/messagepipe.rs b/src/messagepipe.rs index f3e0c67c5..4fd1d54d4 100644 --- a/src/messagepipe.rs +++ b/src/messagepipe.rs @@ -97,7 +97,7 @@ impl MessagePipe { responder .send(response) .map_err(|_| ServiceError::WsClosing { - reason: "could not respond to message pipe request".into(), + reason: "could not respond to message pipe request", })?; Ok(result) diff --git a/src/push_service/keys.rs b/src/push_service/keys.rs index df5892313..f4addb013 100644 --- a/src/push_service/keys.rs +++ b/src/push_service/keys.rs @@ -33,7 +33,7 @@ impl PushService { self.request( Method::GET, Endpoint::Service, - &format!("/v2/keys?identity={}", service_id_type), + format!("/v2/keys?identity={}", service_id_type), HttpAuthOverride::NoOverride, )? .send() @@ -53,7 +53,7 @@ impl PushService { self.request( Method::PUT, Endpoint::Service, - &format!("/v2/keys?identity={}", service_id_type), + format!("/v2/keys?identity={}", service_id_type), HttpAuthOverride::NoOverride, )? .json(&pre_key_state) diff --git a/src/push_service/mod.rs b/src/push_service/mod.rs index b4e52aabc..c6cf31fd5 100644 --- a/src/push_service/mod.rs +++ b/src/push_service/mod.rs @@ -160,7 +160,7 @@ impl PushService { let client = reqwest::ClientBuilder::new() .add_root_certificate( reqwest::Certificate::from_pem( - &cfg.certificate_authority.as_bytes(), + cfg.certificate_authority.as_bytes(), ) .unwrap(), ) @@ -332,11 +332,8 @@ mod tests { let configs = &[SignalServers::Staging, SignalServers::Production]; for cfg in configs { - let _ = super::PushService::new( - cfg, - None, - "libsignal-service test".to_string(), - ); + let _ = + super::PushService::new(cfg, None, "libsignal-service test"); } } diff --git a/src/push_service/registration.rs b/src/push_service/registration.rs index 3e56f1da9..2ab6ea0c2 100644 --- a/src/push_service/registration.rs +++ b/src/push_service/registration.rs @@ -241,7 +241,7 @@ impl PushService { self.request( Method::PATCH, Endpoint::Service, - &format!("/v1/verification/session/{}", session_id), + format!("/v1/verification/session/{}", session_id), HttpAuthOverride::Unidentified, )? .json(&UpdateVerificationSessionRequestBody { @@ -290,7 +290,7 @@ impl PushService { self.request( Method::POST, Endpoint::Service, - &format!("/v1/verification/session/{}/code", session_id), + format!("/v1/verification/session/{}/code", session_id), HttpAuthOverride::Unidentified, )? .json(&VerificationCodeRequest { transport, client }) @@ -316,7 +316,7 @@ impl PushService { self.request( Method::PUT, Endpoint::Service, - &format!("/v1/verification/session/{}/code", session_id), + format!("/v1/verification/session/{}/code", session_id), HttpAuthOverride::Unidentified, )? .json(&VerificationCode { diff --git a/src/websocket/mod.rs b/src/websocket/mod.rs index 1350bab7c..128956eac 100644 --- a/src/websocket/mod.rs +++ b/src/websocket/mod.rs @@ -128,7 +128,7 @@ impl SignalWebSocketProcess { tracing::trace!("sending request with body"); self.request_sink.send((request, sink)).await.map_err( |_| ServiceError::WsClosing { - reason: "request handler failed".into(), + reason: "request handler failed", }, )?; self.outgoing_responses.push(Box::pin(recv)); @@ -197,7 +197,7 @@ impl SignalWebSocketProcess { push_service::KEEPALIVE_TIMEOUT_SECONDS, ); - Ok(loop { + loop { futures::select! { _ = ka_interval.tick().fuse() => { use prost::Message; @@ -309,7 +309,8 @@ impl SignalWebSocketProcess { } } } - }) + } + Ok(()) } }