Skip to content
GitHub Actions / clippy succeeded Jan 22, 2024 in 0s

clippy

25 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 25
Note 0
Help 0

Versions

  • rustc 1.77.0-nightly (ef71f1047 2024-01-21)
  • cargo 1.77.0-nightly (1ae631085 2024-01-17)
  • clippy 0.1.77 (ef71f10 2024-01-21)

Annotations

Check warning on line 121 in src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `std::collections::hash_map::Values<'_, std::string::String, core::peer::Peer>`

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()
    |

Check warning on line 544 in src/plugins/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this let-binding has unit value

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 +         });
    |

Check warning on line 534 in src/plugins/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this let-binding has unit value

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 +         });
    |

Check warning on line 515 in src/plugins/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

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

Check warning on line 505 in src/plugins/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

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

Check warning on line 500 in src/plugins/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

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

Check warning on line 396 in src/plugins/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

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(())
    |

Check warning on line 338 in src/plugins/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

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(())
    |

Check warning on line 334 in src/plugins/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

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(())
    |

Check warning on line 330 in src/plugins/websocket/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

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(())
    |

Check warning on line 494 in src/plugins/websocket/handlers/sites.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `format!`

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

Check warning on line 164 in src/plugins/websocket/handlers/sites.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

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

Check warning on line 157 in src/plugins/websocket/handlers/sites.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

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

Check warning on line 53 in src/plugins/websocket/handlers/sites.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

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

Check warning on line 26 in src/plugins/site_server/media.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `unwrap_err` on `res` after checking its variant with `is_err`

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

Check warning on line 187 in src/plugins/site_server/handlers/users.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary map of the identity function

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

Check warning on line 358 in src/plugins/site_server/handlers/sites.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant pattern matching, consider using `is_some()`

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

Check warning on line 195 in src/plugins/site_server/handlers/sites.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

non-binding `let` on a future

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

Check warning on line 90 in src/plugins/site_server/common.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `default` to create a unit struct

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

Check warning on line 793 in /rustc/ef71f1047e04438181d7cb925a833e2ada6ab390/library/core/src/macros/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

sub-expression diverges

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)

Check warning on line 63 in src/io/content.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `std::collections::btree_map::Keys<'_, std::string::String, std::string::String>`

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()
   |

Check warning on line 463 in src/core/user.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

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 ~         ))
    |

Check warning on line 309 in src/controllers/sites.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

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

Check warning on line 306 in src/controllers/sites.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

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

Check warning on line 281 in src/controllers/sites.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

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