Switch to reqwest #993
ci.yaml
on: pull_request
Check code formatting
32s
Clippy
1m 35s
Matrix: build
Annotations
2 errors and 17 warnings
Check code formatting
Process completed with exit code 1.
|
Build / Rust 1.75
Process completed with exit code 101.
|
Check code formatting
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Build / Rust stable
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Build / Rust 1.75
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
passing a unit value to a function:
src/websocket/mod.rs#L200
warning: passing a unit value to a function
--> src/websocket/mod.rs:200:9
|
200 | / Ok(loop {
201 | | futures::select! {
202 | | _ = ka_interval.tick().fuse() => {
203 | | use prost::Message;
... |
311 | | }
312 | | })
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
= note: `#[warn(clippy::unit_arg)]` on by default
help: move the expression in front of the call and replace it with the unit literal `()`
|
200 ~ loop {
201 + futures::select! {
202 + _ = ka_interval.tick().fuse() => {
203 + use prost::Message;
204 + tracing::debug!("sending keep-alive");
205 + let request = WebSocketRequestMessage {
206 + id: Some(self.next_request_id()),
207 + path: Some(self.keep_alive_path.clone()),
208 + verb: Some("GET".into()),
209 + ..Default::default()
210 + };
211 + self.outgoing_keep_alive_set.insert(request.id.unwrap());
212 + let msg = WebSocketMessage {
213 + r#type: Some(web_socket_message::Type::Request.into()),
214 + request: Some(request),
215 + ..Default::default()
216 + };
217 + let buffer = msg.encode_to_vec();
218 + if let Err(e) = self.ws.send(reqwest_websocket::Message::Binary(buffer)).await {
219 + tracing::info!("Websocket sink has closed: {:?}.", e);
220 + break;
221 + };
222 + },
223 + // Process requests from the application, forward them to Signal
224 + x = self.requests.next() => {
225 + match x {
226 + Some((mut request, responder)) => {
227 + use prost::Message;
228 +
229 + // Regenerate ID if already in the table
230 + request.id = Some(
231 + request
232 + .id
233 + .filter(|x| !self.outgoing_requests.contains_key(x))
234 + .unwrap_or_else(|| self.next_request_id()),
235 + );
236 + tracing::trace!(
237 + request.id,
238 + request.verb,
239 + request.path,
240 + request_body_size_bytes = request.body.as_ref().map(|x| x.len()),
241 + ?request.headers,
242 + "sending WebSocketRequestMessage",
243 + );
244 +
245 + self.outgoing_requests.insert(request.id.unwrap(), responder);
246 + let msg = WebSocketMessage {
247 + r#type: Some(web_socket_message::Type::Request.into()),
248 + request: Some(request),
249 + ..Default::default()
250 + };
251 + let buffer = msg.encode_to_vec();
252 + self.ws.send(reqwest_websocket::Message::Binary(buffer)).await?
253 + }
254 + None => {
255 + return Err(ServiceError::WsClosing {
256 + reason: "end of application request stream; socket closing"
257 + });
258 + }
259 + }
260 + }
261 + // Incoming websocket message
262 + web_socket_item = self.ws.next().fuse() => {
263 + use reqwest_websocket::Message;
264 + match web_socket_item {
265 + Some(Ok(Message::Close { code, reason })) => {
266 + tracing::warn!(%code, reason, "websocket closed");
267 + break;
268 + },
269 + Some(Ok(Message::Binary(frame))) => {
270 + self.process_frame(frame).await?;
271 + }
272 + Some(Ok(Message::Ping(_))) => {
273 + tracing::trace!("received ping");
274 + }
275 + Some(Ok(Message::Pong(_))) => {
276 + tracing::trace!("received pong");
277 + }
278 + Some(Ok(Message::Text(_))) => {
279 + tracing::trace!("received text (unsupported, skipping)");
280 + }
281 + Some(Err(e)) => return Err(ServiceError::WsError(e)),
282 + None => {
283 + return Err(ServiceError::WsClosing {
284 + reason: "end of web request stream; socket closing"
285 + });
286 + }
287 + }
288 + }
289 + response = self.outgoing_responses.next() => {
290 + use prost::Message;
291 + match response {
292 + Some(Ok(response)) => {
293 + tracing::trace!("sending response {:?}", response);
294 +
295 + let msg = WebSocketMessage {
296 + r#type: Some(web_socket_message::Type::Response.into()),
297 + response: Some(response),
298 + ..Default::default()
299 + };
300 + let buffer = msg.encode_to_vec();
301 + self.ws.send(buffer.into()).await?;
302 + }
303 + Some(Err(error)) => {
304 + tracing::error!(%error, "could not generate response to a Signal request; responder was canceled. continuing.");
305 + }
306 + None => {
307 + unreachable!("outgoing responses should never fuse")
308 + }
309 + }
310 + }
311 + }
312 + };
313 + Ok(())
|
|
useless conversion to the same type: `&str`:
src/websocket/mod.rs#L131
warning: useless conversion to the same type: `&str`
--> src/websocket/mod.rs:131:33
|
131 | reason: "request handler failed".into(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"request handler failed"`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/push_service/mod.rs#L163
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/push_service/mod.rs:163:21
|
163 | &cfg.certificate_authority.as_bytes(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `cfg.certificate_authority.as_bytes()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
the borrowed expression implements the required traits:
src/push_service/registration.rs#L319
warning: the borrowed expression implements the required traits
--> src/push_service/registration.rs:319:13
|
319 | &format!("/v1/verification/session/{}/code", session_id),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v1/verification/session/{}/code", session_id)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/push_service/registration.rs#L293
warning: the borrowed expression implements the required traits
--> src/push_service/registration.rs:293:13
|
293 | &format!("/v1/verification/session/{}/code", session_id),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v1/verification/session/{}/code", session_id)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/push_service/registration.rs#L244
warning: the borrowed expression implements the required traits
--> src/push_service/registration.rs:244:13
|
244 | &format!("/v1/verification/session/{}", session_id),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v1/verification/session/{}", session_id)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/push_service/keys.rs#L56
warning: the borrowed expression implements the required traits
--> src/push_service/keys.rs:56:13
|
56 | &format!("/v2/keys?identity={}", service_id_type),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v2/keys?identity={}", service_id_type)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/push_service/keys.rs#L36
warning: the borrowed expression implements the required traits
--> src/push_service/keys.rs:36:13
|
36 | &format!("/v2/keys?identity={}", service_id_type),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v2/keys?identity={}", service_id_type)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
useless conversion to the same type: `&str`:
src/messagepipe.rs#L100
warning: useless conversion to the same type: `&str`
--> src/messagepipe.rs:100:25
|
100 | reason: "could not respond to message pipe request".into(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"could not respond to message pipe request"`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
the borrowed expression implements the required traits:
src/account_manager.rs#L258
warning: the borrowed expression implements the required traits
--> src/account_manager.rs:258:17
|
258 | &format!("/v1/provisioning/{}", destination),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/v1/provisioning/{}", destination)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
Build / Rust beta
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Clippy
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Build / Rust nightly
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|