Skip to content

[WIP] p2p: add `AsyncSecretConnection` based on tokio

Sign in for the full log view
GitHub Actions / clippy failed Aug 28, 2024 in 0s

reviewdog [clippy] report

reported by reviewdog 🐶

Findings (5)

p2p/src/secret_connection.rs|35 col 33| error: item name ends with its containing module's name
--> p2p/src/secret_connection.rs:35:33
|
35 | pub use self::async_connection::AsyncSecretConnection;
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
= note: -D clippy::module-name-repetitions implied by -D warnings
= help: to override -D warnings add #[allow(clippy::module_name_repetitions)]
p2p/src/secret_connection/async_connection.rs|31 col 5| error: future cannot be sent between threads safely
--> p2p/src/secret_connection/async_connection.rs:31:5
|
31 | / pub async fn connect_tcp<A: ToSocketAddrs>(
32 | | addr: A,
33 | | local_privkey: ed25519_consensus::SigningKey,
34 | | protocol_version: Version,
35 | | ) -> Result<Self, Error> {
| |^ future returned by connect_tcp is not Send
|
note: captured value is not Send
--> p2p/src/secret_connection/async_connection.rs:32:9
|
32 | addr: A,
| ^^^^ has type A which is not Send
= note: A doesn't implement std::marker::Send
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
= note: -D clippy::future-not-send implied by -D warnings
= help: to override -D warnings add #[allow(clippy::future_not_send)]
p2p/src/secret_connection/async_connection.rs|108 col 25| error: the following explicit lifetimes could be elided: 'a
--> p2p/src/secret_connection/async_connection.rs:108:25
|
108 | async fn read_chunk<'a>(&'a mut self) -> Result<Vec, Error> {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: -D clippy::needless-lifetimes implied by -D warnings
= help: to override -D warnings add #[allow(clippy::needless_lifetimes)]
p2p/src/secret_connection/async_connection.rs|147 col 5| error: docs for function which may panic missing # Panics section
--> p2p/src/secret_connection/async_connection.rs:147:5
|
147 | pub async fn write_all<'a>(&'a mut self, src: &'a [u8]) -> Result<usize, Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> p2p/src/secret_connection/async_connection.rs:163:17
|
163 | n = n
| _________________^
164 | | .checked_add(chunk.len())
165 | | .expect("overflow when adding chunk lengths");
| |
_________________________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
= note: -D clippy::missing-panics-doc implied by -D warnings
= help: to override -D warnings add #[allow(clippy::missing_panics_doc)]
p2p/src/secret_connection/async_connection.rs|147 col 5| error: docs for function returning Result missing # Errors section
--> p2p/src/secret_connection/async_connection.rs:147:5
|
147 | pub async fn write_all<'a>(&'a mut self, src: &'a [u8]) -> Result<usize, Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
= note: -D clippy::missing-errors-doc implied by -D warnings
= help: to override -D warnings add #[allow(clippy::missing_errors_doc)]

Filtered Findings (3)

p2p/src/lib.rs|1 col 1| error: multiple versions for dependency block-buffer: 0.9.0, 0.10.4
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
= note: -D clippy::multiple-crate-versions implied by -D warnings
= help: to override -D warnings add #[allow(clippy::multiple_crate_versions)]
p2p/src/lib.rs|1 col 1| error: multiple versions for dependency digest: 0.9.0, 0.10.7
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
p2p/src/lib.rs|1 col 1| error: multiple versions for dependency sha2: 0.9.9, 0.10.8
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

Annotations

Check failure on line 35 in p2p/src/secret_connection.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] p2p/src/secret_connection.rs#L35

error: item name ends with its containing module's name
  --> p2p/src/secret_connection.rs:35:33
   |
35 | pub use self::async_connection::AsyncSecretConnection;
   |                                 ^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
   = note: `-D clippy::module-name-repetitions` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::module_name_repetitions)]`
Raw output
p2p/src/secret_connection.rs:35:33:e:error: item name ends with its containing module's name
  --> p2p/src/secret_connection.rs:35:33
   |
35 | pub use self::async_connection::AsyncSecretConnection;
   |                                 ^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
   = note: `-D clippy::module-name-repetitions` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::module_name_repetitions)]`


__END__

Check failure on line 31 in p2p/src/secret_connection/async_connection.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] p2p/src/secret_connection/async_connection.rs#L31

error: future cannot be sent between threads safely
  --> p2p/src/secret_connection/async_connection.rs:31:5
   |
31 | /     pub async fn connect_tcp<A: ToSocketAddrs>(
32 | |         addr: A,
33 | |         local_privkey: ed25519_consensus::SigningKey,
34 | |         protocol_version: Version,
35 | |     ) -> Result<Self, Error> {
   | |____________________________^ future returned by `connect_tcp` is not `Send`
   |
note: captured value is not `Send`
  --> p2p/src/secret_connection/async_connection.rs:32:9
   |
32 |         addr: A,
   |         ^^^^ has type `A` which is not `Send`
   = note: `A` doesn't implement `std::marker::Send`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
   = note: `-D clippy::future-not-send` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
Raw output
p2p/src/secret_connection/async_connection.rs:31:5:e:error: future cannot be sent between threads safely
  --> p2p/src/secret_connection/async_connection.rs:31:5
   |
31 | /     pub async fn connect_tcp<A: ToSocketAddrs>(
32 | |         addr: A,
33 | |         local_privkey: ed25519_consensus::SigningKey,
34 | |         protocol_version: Version,
35 | |     ) -> Result<Self, Error> {
   | |____________________________^ future returned by `connect_tcp` is not `Send`
   |
note: captured value is not `Send`
  --> p2p/src/secret_connection/async_connection.rs:32:9
   |
32 |         addr: A,
   |         ^^^^ has type `A` which is not `Send`
   = note: `A` doesn't implement `std::marker::Send`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
   = note: `-D clippy::future-not-send` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`


__END__

Check failure on line 108 in p2p/src/secret_connection/async_connection.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] p2p/src/secret_connection/async_connection.rs#L108

error: the following explicit lifetimes could be elided: 'a
   --> p2p/src/secret_connection/async_connection.rs:108:25
    |
108 |     async fn read_chunk<'a>(&'a mut self) -> Result<Vec<u8>, Error> {
    |                         ^^   ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
Raw output
p2p/src/secret_connection/async_connection.rs:108:25:e:error: the following explicit lifetimes could be elided: 'a
   --> p2p/src/secret_connection/async_connection.rs:108:25
    |
108 |     async fn read_chunk<'a>(&'a mut self) -> Result<Vec<u8>, Error> {
    |                         ^^   ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`


__END__

Check failure on line 147 in p2p/src/secret_connection/async_connection.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] p2p/src/secret_connection/async_connection.rs#L147

error: docs for function which may panic missing `# Panics` section
   --> p2p/src/secret_connection/async_connection.rs:147:5
    |
147 |     pub async fn write_all<'a>(&'a mut self, src: &'a [u8]) -> Result<usize, Error> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: first possible panic found here
   --> p2p/src/secret_connection/async_connection.rs:163:17
    |
163 |               n = n
    |  _________________^
164 | |                 .checked_add(chunk.len())
165 | |                 .expect("overflow when adding chunk lengths");
    | |_____________________________________________________________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
    = note: `-D clippy::missing-panics-doc` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::missing_panics_doc)]`
Raw output
p2p/src/secret_connection/async_connection.rs:147:5:e:error: docs for function which may panic missing `# Panics` section
   --> p2p/src/secret_connection/async_connection.rs:147:5
    |
147 |     pub async fn write_all<'a>(&'a mut self, src: &'a [u8]) -> Result<usize, Error> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: first possible panic found here
   --> p2p/src/secret_connection/async_connection.rs:163:17
    |
163 |               n = n
    |  _________________^
164 | |                 .checked_add(chunk.len())
165 | |                 .expect("overflow when adding chunk lengths");
    | |_____________________________________________________________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
    = note: `-D clippy::missing-panics-doc` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::missing_panics_doc)]`


__END__

Check failure on line 147 in p2p/src/secret_connection/async_connection.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] p2p/src/secret_connection/async_connection.rs#L147

error: docs for function returning `Result` missing `# Errors` section
   --> p2p/src/secret_connection/async_connection.rs:147:5
    |
147 |     pub async fn write_all<'a>(&'a mut self, src: &'a [u8]) -> Result<usize, Error> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
    = note: `-D clippy::missing-errors-doc` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::missing_errors_doc)]`
Raw output
p2p/src/secret_connection/async_connection.rs:147:5:e:error: docs for function returning `Result` missing `# Errors` section
   --> p2p/src/secret_connection/async_connection.rs:147:5
    |
147 |     pub async fn write_all<'a>(&'a mut self, src: &'a [u8]) -> Result<usize, Error> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
    = note: `-D clippy::missing-errors-doc` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::missing_errors_doc)]`


__END__