chore(volo-http): refactor websocket (#503) #1335
Annotations
28 warnings
security-audit
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/audit-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/
|
security-audit
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions-rs/audit-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/
|
unneeded `return` statement:
examples/src/http/example-http-server.rs#L407
warning: unneeded `return` statement
--> examples/src/http/example-http-server.rs:407:46
|
407 | Server::new(app).run(addr).await.unwrap();
| ^
|
= 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`
|
407 | Server::new(app).run(addr).await.unwrap()Server::new(app).run(addr).await.unwrap();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
examples/src/http/example-http-client.rs#L123
warning: unneeded `return` statement
--> examples/src/http/example-http-client.rs:123:7
|
123 | Ok(())
| ^^^^
|
= 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`
|
123 | OkOk(())
| ~~~~~~
|
unneeded `return` statement:
examples/src/grpc/streaming/server.rs#L118
warning: unneeded `return` statement
--> examples/src/grpc/streaming/server.rs:118:18
|
118 | .unwrap();
| ^
|
= 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`
|
118 ~ .unwrap()Server::new()
119 + .add_service(
120 + ServiceBuilder::new(volo_gen::proto_gen::streaming::StreamingServer::new(S)).build(),
121 + )
122 + .run(addr)
123 + .await
124 + .unwrap();
|
|
unneeded `return` statement:
examples/src/grpc/streaming/client.rs#L19
warning: unneeded `return` statement
--> examples/src/grpc/streaming/client.rs:19:36
|
19 | bidirectional_streaming().await;
| ^
|
= 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`
|
19 | bidirectional_streaming().awaitbidirectional_streaming().await;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
examples/src/grpc/multiplex/client.rs#L35
warning: unneeded `return` statement
--> examples/src/grpc/multiplex/client.rs:35:16
|
35 | match resp {
| ________________^
36 | | Ok(info) => println!("ECHO: {info:?}"),
37 | | Err(e) => eprintln!("ECHO: {e:?}"),
38 | | }
| |_____^
|
= 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`
|
35 ~ match resp match resp {
36 + Ok(info) => println!("ECHO: {info:?}"),
37 + Err(e) => eprintln!("ECHO: {e:?}"),
38 + }
|
|
unneeded `return` statement:
examples/src/grpc/loadbalance/client.rs#L78
warning: unneeded `return` statement
--> examples/src/grpc/loadbalance/client.rs:78:15
|
78 | .await;
| ^
|
= 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`
|
78 ~ .awaitMETAINFO
79 + .scope(RefCell::new(mi), async move {
80 + for _ in 0..3 {
81 + let req = volo_gen::proto_gen::helloworld::HelloRequest {
82 + name: FastStr::from_static_str("Volo"),
83 + };
84 + set_request_hash(ip_to_u64(&get_local_ip().unwrap()));
85 + let resp = CLIENT.say_hello(req).await;
86 + match resp {
87 + Ok(info) => println!("{info:?}"),
88 + Err(e) => eprintln!("{e:?}"),
89 + }
90 + }
91 + for _ in 0..3 {
92 + let req = volo_gen::proto_gen::helloworld::HelloRequest {
93 + name: FastStr::from_static_str("Volo"),
94 + };
95 + set_request_hash(1000);
96 + let resp = CLIENT.clone().say_hello(req).await;
97 + match resp {
98 + Ok(info) => println!("{info:?}"),
99 + Err(e) => eprintln!("{e:?}"),
100+ }
101+ }
102+ })
103+ .await;
|
|
unneeded `return` statement:
examples/src/thrift/multiplex/client.rs#L43
warning: unneeded `return` statement
--> examples/src/thrift/multiplex/client.rs:43:34
|
43 | future::pending::<()>().await;
| ^
|
= 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`
|
43 ~ future::pending::<()>().awaitfor i in 0..resps.capacity() {
44 + resps.push(tokio::spawn(futs(i)));
45 + }
46 +
47 + for resp in resps {
48 + let _ = resp.await;
49 + }
50 + future::pending::<()>().await;
|
|
unneeded `return` statement:
examples/src/grpc/compression/client.rs#L30
warning: unneeded `return` statement
--> examples/src/grpc/compression/client.rs:30:16
|
30 | match resp {
| ________________^
31 | | Ok(info) => println!("{info:?}"),
32 | | Err(e) => eprintln!("{e:?}"),
33 | | }
| |_____^
|
= 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`
|
30 ~ match resp match resp {
31 + Ok(info) => println!("{info:?}"),
32 + Err(e) => eprintln!("{e:?}"),
33 + }
|
|
unneeded `return` statement:
examples/src/grpc/compression/server.rs#L45
warning: unneeded `return` statement
--> examples/src/grpc/compression/server.rs:45:18
|
45 | .unwrap();
| ^
|
= 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`
|
45 ~ .unwrap()Server::new()
46 + .add_service(
47 + ServiceBuilder::new(volo_gen::proto_gen::helloworld::GreeterServer::new(S))
48 + .send_compressions(vec![
49 + Zlib(Some(ZlibConfig {
50 + level: Level::fast(),
51 + })),
52 + Gzip(Some(GzipConfig::default())),
53 + ])
54 + .accept_compressions(vec![Gzip(None), Zlib(None), Identity])
55 + .build(),
56 + )
57 + .run(addr)
58 + .await
59 + .unwrap();
|
|
unneeded `return` statement:
examples/src/thrift/multiplex/server.rs#L31
warning: unneeded `return` statement
--> examples/src/thrift/multiplex/server.rs:31:18
|
31 | .unwrap();
| ^
|
= 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`
|
31 ~ .unwrap()volo_gen::thrift_gen::hello::HelloServiceServer::new(S)
32 + .multiplex(true)
33 + .run(addr)
34 + .await
35 + .unwrap();
|
|
unneeded `return` statement:
examples/src/grpc/multiplex/server.rs#L47
warning: unneeded `return` statement
--> examples/src/grpc/multiplex/server.rs:47:18
|
47 | .unwrap();
| ^
|
= 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`
|
47 ~ .unwrap()Server::new()
48 + .add_service(
49 + ServiceBuilder::new(volo_gen::proto_gen::helloworld::GreeterServer::new(G)).build(),
50 + )
51 + .add_service(ServiceBuilder::new(volo_gen::proto_gen::echo::EchoServer::new(E)).build())
52 + .run(addr)
53 + .await
54 + .unwrap();
|
|
unneeded `return` statement:
examples/src/thrift/unknown/server.rs#L28
warning: unneeded `return` statement
--> examples/src/thrift/unknown/server.rs:28:18
|
28 | .unwrap();
| ^
|
= 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`
|
28 ~ .unwrap()volo_gen::thrift_gen::echo_unknown::EchoServiceServer::new(S)
29 + .run(addr)
30 + .await
31 + .unwrap();
|
|
unneeded `return` statement:
examples/src/grpc/hello/client.rs#L18
warning: unneeded `return` statement
--> examples/src/grpc/hello/client.rs:18:16
|
18 | match resp {
| ________________^
19 | | Ok(info) => println!("{info:?}"),
20 | | Err(e) => eprintln!("{e:?}"),
21 | | }
| |_____^
|
= 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`
|
18 ~ match resp match resp {
19 + Ok(info) => println!("{info:?}"),
20 + Err(e) => eprintln!("{e:?}"),
21 + }
|
|
unneeded `return` statement:
examples/src/thrift/hello/server.rs#L26
warning: unneeded `return` statement
--> examples/src/thrift/hello/server.rs:26:18
|
26 | .unwrap();
| ^
|
= 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`
|
26 ~ .unwrap()volo_gen::thrift_gen::hello::HelloServiceServer::new(S)
27 + .run(addr)
28 + .await
29 + .unwrap();
|
|
unneeded `return` statement:
examples/src/thrift/hello/server_panic.rs#L26
warning: unneeded `return` statement
--> examples/src/thrift/hello/server_panic.rs:26:18
|
26 | .unwrap();
| ^
|
= 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`
|
26 ~ .unwrap()volo_gen::thrift_gen::hello::HelloServiceServer::new(S)
27 + .layer_front(volo::catch_panic::Layer::new(log_and_return_exception))
28 + .run(addr)
29 + .await
30 + .unwrap();
|
|
unneeded `return` statement:
examples/src/grpc/loadbalance/server.rs#L64
warning: unneeded `return` statement
--> examples/src/grpc/loadbalance/server.rs:64:25
|
64 | println!("shutdown");
| ^
|
= 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`
|
64 | println!("shutdown")println!("shutdown");
| ~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
examples/src/thrift/unknown/client.rs#L29
warning: unneeded `return` statement
--> examples/src/thrift/unknown/client.rs:29:16
|
29 | match resp {
| ________________^
30 | | Ok(info) => println!("{info:?}"),
31 | | Err(e) => eprintln!("{e:?}"),
32 | | }
| |_____^
|
= 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`
|
29 ~ match resp match resp {
30 + Ok(info) => println!("{info:?}"),
31 + Err(e) => eprintln!("{e:?}"),
32 + }
|
|
unneeded `return` statement:
examples/src/grpc/grpc-web/server.rs#L36
warning: unneeded `return` statement
--> examples/src/grpc/grpc-web/server.rs:36:18
|
36 | .unwrap();
| ^
|
= 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`
|
36 ~ .unwrap()Server::new()
37 + .accept_http1(true)
38 + .layer_tower(GrpcWebLayer::new())
39 + .add_service(
40 + ServiceBuilder::new(volo_gen::proto_gen::helloworld::GreeterServer::new(S)).build(),
41 + )
42 + .run(addr)
43 + .await
44 + .unwrap();
|
|
unneeded `return` statement:
examples/src/grpc/grpc-web/client.rs#L36
warning: unneeded `return` statement
--> examples/src/grpc/grpc-web/client.rs:36:52
|
36 | assert_eq!(&trailers[..], b"grpc-status:0\r\n");
| ^
|
= 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`
|
36 | assert_eq!(&trailers[..], b"grpc-status:0\r\n")assert_eq!(&trailers[..], b"grpc-status:0\r\n");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
examples/src/grpc/hello/server.rs#L31
warning: unneeded `return` statement
--> examples/src/grpc/hello/server.rs:31:18
|
31 | .unwrap();
| ^
|
= 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`
|
31 ~ .unwrap()Server::new()
32 + .add_service(
33 + ServiceBuilder::new(volo_gen::proto_gen::helloworld::GreeterServer::new(S)).build(),
34 + )
35 + .run(addr)
36 + .await
37 + .unwrap();
|
|
unneeded `return` statement:
examples/src/thrift/hello/client.rs#L22
warning: unneeded `return` statement
--> examples/src/thrift/hello/client.rs:22:16
|
22 | match resp {
| ________________^
23 | | Ok(info) => println!("{info:?}"),
24 | | Err(e) => eprintln!("{e:?}"),
25 | | }
| |_____^
|
= 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`
|
22 ~ match resp match resp {
23 + Ok(info) => println!("{info:?}"),
24 + Err(e) => eprintln!("{e:?}"),
25 + }
|
|
empty line after doc comment:
volo-grpc/src/status.rs#L171
warning: empty line after doc comment
--> volo-grpc/src/status.rs:171:5
|
171 | / /// Create a new [`Status`] with the associated code and message.
172 | |
| |_
173 | pub fn new(code: Code, message: impl Into<String>) -> Self {
| ---------------------------------------------------------- the comment documents this associated function
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
= note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
= help: if the empty line is unintentional remove it
|
unneeded `return` statement:
benchmark/src/bin/client.rs#L97
warning: unneeded `return` statement
--> benchmark/src/bin/client.rs:97:21
|
97 | recoder.report();
| ^
|
= 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`
|
97 | recoder.report()recoder.report();
| ~~~~~~~~~~~~~~~~~
|
unneeded `return` statement:
benchmark/src/bin/server.rs#L34
warning: unneeded `return` statement
--> benchmark/src/bin/server.rs:34:18
|
34 | .unwrap();
| ^
|
= 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`
|
34 ~ .unwrap()benchmark::benchmark::echo::EchoServerServer::new(S)
35 + .run(addr)
36 + .await
37 + .unwrap();
|
|
casting to the same type is unnecessary (`u64` -> `u64`):
benchmark/src/perf/mem.rs#L62
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> benchmark/src/perf/mem.rs:62:41
|
62 | mem_usage_list.push(mem_usage as u64);
| ^^^^^^^^^^^^^^^^ help: try: `mem_usage`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
|
empty line after doc comment:
volo-thrift/src/codec/default/thrift.rs#L37
warning: empty line after doc comment
--> volo-thrift/src/codec/default/thrift.rs:37:5
|
37 | / /// This is unimplemented yet.
38 | | // pub fn with_multiplex(mut self, multiplex: bool) -> Self {
39 | | // self.multiplex = multiplex;
40 | | // self
41 | | // }
42 | |
| |_
...
45 | pub fn with_protocol(mut self, protocol: Protocol) -> Self {
| ---------------------------------------------------------- the comment documents this method
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
= note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
= help: if the empty line is unintentional remove it
help: if the doc comment should not document `with_protocol` comment it out
|
29 ~ // /// Whether to use thrift multiplex protocol.
30 ~ // ///
31 ~ // /// When the multiplexed protocol is used, the name contains the service name,
32 ~ // /// a colon : and the method name. The multiplexed protocol is not compatible
33 ~ // /// with other protocols.
34 ~ // ///
35 ~ // /// Spec: <https://github.com/apache/thrift/blob/master/doc/specs/thrift-rpc.md>
36 ~ // ///
37 ~ // /// This is unimplemented yet.
|
|