Skip to content

lint: cargo fmt

lint: cargo fmt #144

Triggered via push January 22, 2024 20:15
Status Failure
Total duration 4m 34s
Artifacts

tools.yml

on: push
Matrix: Build and test
Fit to window
Zoom out
Zoom in

Annotations

1 error and 52 warnings
Build and test (--all-features)
Process completed with exit code 101.
rustfmt
The following actions uses node12 which is deprecated and will be forced to run on node16: styfle/[email protected], actions/[email protected], actions-rs/[email protected]. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
rustfmt
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
rustfmt
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
rustfmt
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
useless conversion to the same type: `std::collections::hash_map::Values<'_, std::string::String, core::peer::Peer>`: src/main.rs#L118
warning: useless conversion to the same type: `std::collections::hash_map::Values<'_, std::string::String, core::peer::Peer>` --> src/main.rs:118:49 | 118 | let mut connectable_peers = site | _________________________________________________^ 119 | | .peers 120 | | .values() 121 | | .into_iter() | |____________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing `.into_iter()` | 118 ~ let mut connectable_peers = site 119 + .peers 120 + .values() |
this let-binding has unit value: src/plugins/websocket/mod.rs#L540
warning: this let-binding has unit value --> src/plugins/websocket/mod.rs:540:9 | 540 | / let _ = self.ws_controller.do_send(ServerEvent::Notification { 541 | | cmd: "notification".to_string(), 542 | | id, 543 | | params, 544 | | }); | |___________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value help: omit the `let` binding | 540 ~ self.ws_controller.do_send(ServerEvent::Notification { 541 + cmd: "notification".to_string(), 542 + id, 543 + params, 544 + }); |
this let-binding has unit value: src/plugins/websocket/mod.rs#L530
warning: this let-binding has unit value --> src/plugins/websocket/mod.rs:530:9 | 530 | / let _ = self.ws_controller.do_send(ServerEvent::Event { 531 | | id: self.next_message_id, 532 | | cmd: event_name.to_string(), 533 | | params: event, 534 | | }); | |___________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value = note: `#[warn(clippy::let_unit_value)]` on by default help: omit the `let` binding | 530 ~ self.ws_controller.do_send(ServerEvent::Event { 531 + id: self.next_message_id, 532 + cmd: event_name.to_string(), 533 + params: event, 534 + }); |
length comparison to zero: src/plugins/websocket/mod.rs#L515
warning: length comparison to zero --> src/plugins/websocket/mod.rs:515:20 | 515 | if params.len() > 0 { | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!params.is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
length comparison to zero: src/plugins/websocket/mod.rs#L505
warning: length comparison to zero --> src/plugins/websocket/mod.rs:505:20 | 505 | if params.len() > 0 { | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!params.is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero = note: `#[warn(clippy::len_zero)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: src/plugins/websocket/mod.rs#L500
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/plugins/websocket/mod.rs:500:55 | 500 | let site_info = append_user_site_data(&self, &mut site_info).unwrap(); | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
unneeded `return` statement: src/plugins/websocket/mod.rs#L396
warning: unneeded `return` statement --> src/plugins/websocket/mod.rs:396:9 | 396 | return Ok(()); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 396 - return Ok(()); 396 + Ok(()) |
unneeded `return` statement: src/plugins/websocket/mod.rs#L338
warning: unneeded `return` statement --> src/plugins/websocket/mod.rs:338:17 | 338 | return Ok(()); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 338 - return Ok(()); 338 + Ok(()) |
unneeded `return` statement: src/plugins/websocket/mod.rs#L334
warning: unneeded `return` statement --> src/plugins/websocket/mod.rs:334:17 | 334 | return Ok(()); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 334 - return Ok(()); 334 + Ok(()) |
unneeded `return` statement: src/plugins/websocket/mod.rs#L330
warning: unneeded `return` statement --> src/plugins/websocket/mod.rs:330:17 | 330 | return Ok(()); | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 330 - return Ok(()); 330 + Ok(()) |
useless use of `format!`: src/plugins/websocket/handlers/sites.rs#L494
warning: useless use of `format!` --> src/plugins/websocket/handlers/sites.rs:494:20 | 494 | error: format!("Can't change this key"), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Can't change this key".to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format = note: `#[warn(clippy::useless_format)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: src/plugins/websocket/handlers/sites.rs#L164
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/plugins/websocket/handlers/sites.rs:164:40 | 164 | if accepted_providers.contains(&provider) || accept_any || accepted_pattern_match { | ^^^^^^^^^ help: change this to: `provider` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/plugins/websocket/handlers/sites.rs#L157
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/plugins/websocket/handlers/sites.rs:157:32 | 157 | regex.is_match(&provider) | ^^^^^^^^^ help: change this to: `provider` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
redundant closure: src/plugins/websocket/handlers/sites.rs#L53
warning: redundant closure --> src/plugins/websocket/handlers/sites.rs:53:31 | 53 | Some(Box::new(move |ws, cmd| cert_add_confirm(ws, cmd))), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `cert_add_confirm` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure = note: `#[warn(clippy::redundant_closure)]` on by default
called `unwrap_err` on `res` after checking its variant with `is_err`: src/plugins/site_server/media.rs#L26
warning: called `unwrap_err` on `res` after checking its variant with `is_err` --> src/plugins/site_server/media.rs:26:15 | 25 | if res.is_err() { | --------------- help: try: `if let Err(..) = res` 26 | match res.unwrap_err() { | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
unnecessary map of the identity function: src/plugins/site_server/handlers/users.rs#L186
warning: unnecessary map of the identity function --> src/plugins/site_server/handlers/users.rs:186:37 | 186 | .into_iter() | _____________________________________^ 187 | | .map(|(addr, site_data)| (addr, site_data)) | |___________________________________________________________________^ help: remove the call to `map` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity = note: `#[warn(clippy::map_identity)]` on by default
redundant pattern matching, consider using `is_some()`: src/plugins/site_server/handlers/sites.rs#L358
warning: redundant pattern matching, consider using `is_some()` --> src/plugins/site_server/handlers/sites.rs:358:16 | 358 | if let Some(_) = self.sites.remove(&msg.address) { | -------^^^^^^^---------------------------------- help: try: `if self.sites.remove(&msg.address).is_some()` | = note: this will change drop order of the result, as well as all temporaries = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching = note: `#[warn(clippy::redundant_pattern_matching)]` on by default
non-binding `let` on a future: src/plugins/site_server/handlers/sites.rs#L195
warning: non-binding `let` on a future --> src/plugins/site_server/handlers/sites.rs:195:13 | 195 | let _ = self.load_content(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider awaiting the future or dropping explicitly with `std::mem::drop` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future = note: `#[warn(clippy::let_underscore_future)]` on by default
use of `default` to create a unit struct: src/plugins/site_server/common.rs#L90
warning: use of `default` to create a unit struct --> src/plugins/site_server/common.rs:90:25 | 90 | let mut rand = OsRng::default(); | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default
sub-expression diverges: /rustc/ef71f1047e04438181d7cb925a833e2ada6ab390/library/core/src/macros/mod.rs#L793
warning: sub-expression diverges --> src/io/site.rs:484:9 | 484 | unimplemented!() | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#diverging_sub_expression = note: `#[warn(clippy::diverging_sub_expression)]` on by default = note: this warning originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
useless conversion to the same type: `std::collections::btree_map::Keys<'_, std::string::String, std::string::String>`: src/io/content.rs#L60
warning: useless conversion to the same type: `std::collections::btree_map::Keys<'_, std::string::String, std::string::String>` --> src/io/content.rs:60:24 | 60 | let verified = content | ________________________^ 61 | | .signs 62 | | .keys() 63 | | .into_iter() | |________________________^ | = 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 help: consider removing `.into_iter()` | 60 ~ let verified = content 61 + .signs 62 + .keys() |
unneeded `return` statement: src/core/user.rs#L459
warning: unneeded `return` statement --> src/core/user.rs:459:9 | 459 | / return Some(format!( 460 | | "{}@{}", 461 | | cert.auth_user_name, 462 | | site_data.get_cert_provider().unwrap() 463 | | )); | |__________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 459 ~ Some(format!( 460 + "{}@{}", 461 + cert.auth_user_name, 462 + site_data.get_cert_provider().unwrap() 463 ~ )) |
this expression creates a reference which is immediately dereferenced by the compiler: src/controllers/sites.rs#L309
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/controllers/sites.rs:309:48 | 309 | new_query = re.replace_all(&query, replacement.as_str()).into(); | ^^^^^^ help: change this to: `query` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/controllers/sites.rs#L306
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/controllers/sites.rs:306:45 | 306 | let key = regex::escape(&key); | ^^^^ help: change this to: `key` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/controllers/sites.rs#L281
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/controllers/sites.rs:281:40 | 281 | new_query = re.replace(&query, &wheres).into(); | ^^^^^^ help: change this to: `query` | = 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
check-clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: styfle/[email protected], actions/[email protected], actions-rs/[email protected], Swatinem/[email protected], 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/
check-clippy
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
check-clippy
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
check-clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
check-clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
check-clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
check-clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
check-clippy
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
check-clippy
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
check-clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build and test (--all-features)
The following actions uses node12 which is deprecated and will be forced to run on node16: styfle/[email protected], actions/[email protected], actions-rs/[email protected], Swatinem/[email protected]. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Build and test (--all-features)
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build and test (--all-features)
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build and test (--all-features)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build and test (--all-features)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build and test (--all-features)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build and test (--all-features)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build and test (--all-features)
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build and test (--all-features)
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Build and test (--all-features)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/