add ResponseSender::close shortcut. #1511
Annotations
3 errors and 18 warnings
mismatched types:
web/src/service/file.rs#L98
error[E0308]: mismatched types
--> web/src/service/file.rs:98:66
|
98 | RouterError::NotAllowed(MethodNotAllowed(vec![Method::GET, Method::HEAD]))
| ---------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<Vec<Method>>`, found `Vec<Method>`
| |
| arguments to this struct are incorrect
|
= note: expected struct `std::boxed::Box<std::vec::Vec<_>>`
found struct `std::vec::Vec<_>`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
note: tuple struct defined here
--> /home/runner/work/xitca-web/xitca-web/http/src/util/service/route.rs:179:12
|
179 | pub struct MethodNotAllowed(pub Box<Vec<Method>>);
| ^^^^^^^^^^^^^^^^
|
mismatched types:
web/src/service/file.rs#L98
error[E0308]: mismatched types
--> web/src/service/file.rs:98:66
|
98 | RouterError::NotAllowed(MethodNotAllowed(vec![Method::GET, Method::HEAD]))
| ---------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<Vec<Method>>`, found `Vec<Method>`
| |
| arguments to this struct are incorrect
|
= note: expected struct `std::boxed::Box<std::vec::Vec<_>>`
found struct `std::vec::Vec<_>`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
note: tuple struct defined here
--> /home/runner/work/xitca-web/xitca-web/http/src/util/service/route.rs:179:12
|
179 | pub struct MethodNotAllowed(pub Box<Vec<Method>>);
| ^^^^^^^^^^^^^^^^
|
clippy
Clippy had exited with the 101 exit code
|
fmt
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
fmt
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
fmt
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/
|
fmt
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/
|
fmt
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/
|
fmt
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/
|
non-local `impl` definition, they should be avoided as they go against expectation:
client/src/tls/connector.rs#L100
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> client/src/tls/connector.rs:100:5
|
100 | / impl<'n> Service<(&'n str, Box<dyn Io>)> for TlsConnector {
101 | | type Response = (Box<dyn Io>, Version);
102 | | type Error = Error;
103 | |
... |
119 | | }
120 | | }
| |_____^
|
= help: move this `impl` block outside the of the current function `rustls`
= note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
|
non-local `impl` definition, they should be avoided as they go against expectation:
client/src/tls/connector.rs#L50
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> client/src/tls/connector.rs:50:5
|
50 | / impl<'n> Service<(&'n str, Box<dyn Io>)> for SslConnector {
51 | | type Response = (Box<dyn Io>, Version);
52 | | type Error = Error;
53 | |
... |
72 | | }
73 | | }
| |_____^
|
= help: move this `impl` block outside the of the current function `openssl`
= note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
= note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
= note: `#[warn(non_local_definitions)]` on by default
|
`Box::new(_)` of default value:
http/src/util/service/route.rs#L232
warning: `Box::new(_)` of default value
--> http/src/util/service/route.rs:232:54
|
232 | Err(RouterError::NotAllowed(MethodNotAllowed(Box::new(Vec::new()))))
| ^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#box_default
= note: `#[warn(clippy::box_default)]` on by default
|
`Box::new(_)` of default value:
http/src/util/service/route.rs#L232
warning: `Box::new(_)` of default value
--> http/src/util/service/route.rs:232:54
|
232 | Err(RouterError::NotAllowed(MethodNotAllowed(Box::new(Vec::new()))))
| ^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#box_default
= note: `#[warn(clippy::box_default)]` on by default
|
this function can be simplified using the `async fn` syntax:
http-ws/src/stream.rs#L246
warning: this function can be simplified using the `async fn` syntax
--> http-ws/src/stream.rs:246:5
|
246 | / pub fn close(
247 | | self,
248 | | reason: Option<impl Into<CloseReason> + 'static>,
249 | | ) -> impl Future<Output = Result<(), ProtocolError>> + 'static {
| |__________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
= note: `#[warn(clippy::manual_async_fn)]` on by default
help: make the function `async` and return the output of the future directly
|
246 ~ pub async fn close(
247 + self,
248 + reason: Option<impl Into<CloseReason> + 'static>,
249 ~ ) -> Result<(), ProtocolError> {
|
help: move the body of the async block to the enclosing function
|
249 | ) -> impl Future<Output = Result<(), ProtocolError>> + 'static { self.send(Message::Close(reason.map(Into::into))).await }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
this function can be simplified using the `async fn` syntax:
http-ws/src/stream.rs#L246
warning: this function can be simplified using the `async fn` syntax
--> http-ws/src/stream.rs:246:5
|
246 | / pub fn close(
247 | | self,
248 | | reason: Option<impl Into<CloseReason> + 'static>,
249 | | ) -> impl Future<Output = Result<(), ProtocolError>> + 'static {
| |__________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
= note: `#[warn(clippy::manual_async_fn)]` on by default
help: make the function `async` and return the output of the future directly
|
246 ~ pub async fn close(
247 + self,
248 + reason: Option<impl Into<CloseReason> + 'static>,
249 ~ ) -> Result<(), ProtocolError> {
|
help: move the body of the async block to the enclosing function
|
249 | ) -> impl Future<Output = Result<(), ProtocolError>> + 'static { self.send(Message::Close(reason.map(Into::into))).await }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
clippy
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, 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 `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/
|
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/
|
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/
|
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/
|