chore(volo-grpc): bump hyper
to 1.0 (#285)
#698
ci.yaml
on: push
test-linux
1m 29s
test-linux-aarch64
2m 26s
test-macos
5m 39s
test-windows
8m 1s
lint
1m 6s
CI is green
0s
Annotations
75 warnings
accessing first element with `request
.phones.get(0)`:
examples/src/http/simple.rs#L34
warning: accessing first element with `request
.phones.get(0)`
--> examples/src/http/simple.rs:34:23
|
34 | let first_phone = request
| _______________________^
35 | | .phones
36 | | .get(0)
| |_______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `#[warn(clippy::get_first)]` on by default
help: try
|
34 ~ let first_phone = request
35 + .phones.first()
|
|
useless conversion to the same type: `hyper::body::Incoming`:
volo-http/src/server.rs#L254
warning: useless conversion to the same type: `hyper::body::Incoming`
--> volo-http/src/server.rs:254:27
|
254 | let req = req.into();
| ^^^^^^^^^^ help: consider removing `.into()`: `req`
|
= 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
|
you should consider adding a `Default` implementation for `MethodRouterBuilder<S>`:
volo-http/src/route.rs#L392
warning: you should consider adding a `Default` implementation for `MethodRouterBuilder<S>`
--> volo-http/src/route.rs:392:5
|
392 | / pub fn new() -> Self {
393 | | Self {
394 | | router: MethodRouter::new(),
395 | | }
396 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
388 + impl<S> Default for MethodRouterBuilder<S>
389 + where
390 + S: Clone + Send + Sync + 'static,
391 + {
392 + fn default() -> Self {
393 + Self::new()
394 + }
395 + }
|
|
you should consider adding a `Default` implementation for `MethodRouter<S>`:
volo-http/src/route.rs#L245
warning: you should consider adding a `Default` implementation for `MethodRouter<S>`
--> volo-http/src/route.rs:245:5
|
245 | / pub fn new() -> Self {
246 | | Self {
247 | | options: MethodEndpoint::None,
248 | | get: MethodEndpoint::None,
... |
257 | | }
258 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
241 + impl<S> Default for MethodRouter<S>
242 + where
243 + S: Clone + Send + Sync + 'static,
244 + {
245 + fn default() -> Self {
246 + Self::new()
247 + }
248 + }
|
|
this let-binding has unit value:
volo-http/src/route.rs#L209
warning: this let-binding has unit value
--> volo-http/src/route.rs:209:9
|
209 | / let _ = self
210 | | .router
211 | | .insert(uri, route_id)
212 | | .map_err(MatcherError::RouterInsertError)?;
| |_______________________________________________________^
|
= 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
|
209 ~ self
210 + .router
211 + .insert(uri, route_id)
212 + .map_err(MatcherError::RouterInsertError)?;
|
|
you should consider adding a `Default` implementation for `Router<S>`:
volo-http/src/route.rs#L47
warning: you should consider adding a `Default` implementation for `Router<S>`
--> volo-http/src/route.rs:47:5
|
47 | / pub fn new() -> Self {
48 | | Self {
49 | | matcher: Default::default(),
50 | | routes: Default::default(),
... |
53 | | }
54 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
43 + impl<S> Default for Router<S>
44 + where
45 + S: Clone + Send + Sync + 'static,
46 + {
47 + fn default() -> Self {
48 + Self::new()
49 + }
50 + }
|
|
very complex type used. Consider factoring parts into `type` definitions:
volo-http/src/layer.rs#L20
warning: very complex type used. Consider factoring parts into `type` definitions
--> volo-http/src/layer.rs:20:10
|
20 | ) -> FilterLayer<Box<dyn Fn(&mut HttpContext, &Request) -> Result<(), StatusCode>>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
|
unsafe function's docs miss `# Safety` section:
volo-http/src/extract.rs#L61
warning: unsafe function's docs miss `# Safety` section
--> volo-http/src/extract.rs:61:5
|
61 | pub unsafe fn assume_valid(self) -> FastStr {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
|
unsafe function's docs miss `# Safety` section:
volo-http/src/extract.rs#L55
warning: unsafe function's docs miss `# Safety` section
--> volo-http/src/extract.rs:55:5
|
55 | pub unsafe fn assume_valid(self) -> String {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
= note: `#[warn(clippy::missing_safety_doc)]` on by default
|
using `clone` on type `DefaultMakeTransport` which implements the `Copy` trait:
volo-grpc/src/transport/connect.rs#L50
warning: using `clone` on type `DefaultMakeTransport` which implements the `Copy` trait
--> volo-grpc/src/transport/connect.rs:50:31
|
50 | let mk_conn = mk_conn.clone();
| ^^^^^^^^^^^^^^^ help: try dereferencing it: `*mk_conn`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
|
use of `unwrap_or_else` to construct default value:
volo-grpc/src/status.rs#L454
warning: use of `unwrap_or_else` to construct default value
--> volo-grpc/src/status.rs:454:18
|
454 | .unwrap_or_else(Bytes::new);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
|
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`:
volo-grpc/src/server/meta.rs#L132
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
--> volo-grpc/src/server/meta.rs:132:68
|
132 | status_to_http!(metainfo::METAINFO.with(|metainfo| {
| ____________________________________________________________________^
133 | | let metainfo = metainfo.borrow_mut();
134 | |
135 | | // backward
... |
143 | | Ok::<(), Status>(())
144 | | }));
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
|
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`:
volo-grpc/src/server/meta.rs#L65
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
--> volo-grpc/src/server/meta.rs:65:68
|
65 | status_to_http!(metainfo::METAINFO.with(|metainfo| {
| ____________________________________________________________________^
66 | | let mut metainfo = metainfo.borrow_mut();
67 | |
68 | | // caller
... |
120 | | Ok::<(), Status>(())
121 | | }));
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
= note: `#[warn(clippy::blocks_in_conditions)]` on by default
|
unneeded `return` statement:
volo-grpc/src/codec/decode.rs#L108
warning: unneeded `return` statement
--> volo-grpc/src/codec/decode.rs:108:21
|
108 | / return Err(Status::new(
109 | | Code::Internal,
110 | | "Unexpected data from stream.".to_string(),
111 | | ));
| |______________________^
|
= 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`
|
108 ~ Err(Status::new(
109 + Code::Internal,
110 + "Unexpected data from stream.".to_string(),
111 ~ ))
|
|
try not to call a closure in the expression where it is declared:
volo-thrift/src/codec/default/mod.rs#L136
warning: try not to call a closure in the expression where it is declared
--> volo-thrift/src/codec/default/mod.rs:136:28
|
136 | let write_result = (|| async {
| ____________________________^
137 | | self.linked_bytes.reset();
138 | | // then we reserve the size of the message in the linked bytes
139 | | self.linked_bytes.reserve(malloc_size);
... |
158 | | Ok::<(), crate::Error>(())
159 | | })()
| |____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: `#[warn(clippy::redundant_closure_call)]` on by default
help: try doing something like
|
136 ~ let write_result = async {
137 + self.linked_bytes.reset();
138 + // then we reserve the size of the message in the linked bytes
139 + self.linked_bytes.reserve(malloc_size);
140 + // after that, we encode the message into the linked bytes
141 + self.encoder
142 + .encode(cx, &mut self.linked_bytes, msg)
143 + .map_err(|e| {
144 + // record the error time
145 + cx.stats_mut().record_encode_end_at();
146 + e
147 + })?;
148 +
149 + cx.stats_mut().record_encode_end_at();
150 + cx.stats_mut().record_write_start_at(); // encode end is also write start
151 +
152 + self.linked_bytes
153 + .write_all_vectored(&mut self.writer)
154 + .await
155 + .map_err(TransportError::from)?;
156 + self.writer.flush().await.map_err(TransportError::from)?;
157 +
158 + Ok::<(), crate::Error>(())
159 + }
|
|
unneeded `return` statement:
volo-thrift/src/codec/default/ttheader.rs#L132
warning: unneeded `return` statement
--> volo-thrift/src/codec/default/ttheader.rs:132:13
|
132 | return self.inner.decode_async(cx, reader).await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
132 - return self.inner.decode_async(cx, reader).await;
132 + self.inner.decode_async(cx, reader).await
|
|
unneeded `return` statement:
volo-thrift/src/codec/default/framed.rs#L140
warning: unneeded `return` statement
--> volo-thrift/src/codec/default/framed.rs:140:13
|
140 | return self.inner.decode_async(cx, reader).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`
|
140 - return self.inner.decode_async(cx, reader).await;
140 + self.inner.decode_async(cx, reader).await
|
|
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`:
volo-thrift/src/client/mod.rs#L607
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
--> volo-thrift/src/client/mod.rs:607:13
|
607 | / cache
608 | | .pop()
609 | | .and_then(|mut cx| {
610 | | // The generated code only push the cx to the cache, we need to reset
... |
635 | | Some(cx)
636 | | })
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
= note: `#[warn(clippy::bind_instead_of_map)]` on by default
help: try
|
609 ~ .map(|mut cx| {
610 | // The generated code only push the cx to the cache, we need to reset
...
634 | .set_method(FastStr::from_static_str(method));
635 ~ cx
|
|
this function has too many arguments (8/7):
volo-thrift/src/transport/pingpong/server.rs#L21
warning: this function has too many arguments (8/7)
--> volo-thrift/src/transport/pingpong/server.rs:21:1
|
21 | / pub async fn serve<Svc, Req, Resp, E, D, SP>(
22 | | mut encoder: E,
23 | | mut decoder: D,
24 | | notified: Notified<'_>,
... |
36 | | D: Decoder,
37 | | SP: SpanProvider,
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
use of a fallible conversion when an infallible one could be used:
volo-thrift/src/error.rs#L302
warning: use of a fallible conversion when an infallible one could be used
--> volo-thrift/src/error.rs:302:61
|
302 | let remote_kind: ApplicationErrorKind = TryFrom::try_from(remote_type_as_int)
| ^^^^^^^^^^^^^^^^^ help: use: `From::from`
|
= note: converting `i32` to `ApplicationErrorKind` cannot fail
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
|
unused imports: `TFieldIdentifier`, `TListIdentifier`, `TMapIdentifier`, `TSetIdentifier`, `TStructIdentifier`, `TType`:
volo-thrift/src/protocol/mod.rs#L3
warning: unused imports: `TFieldIdentifier`, `TListIdentifier`, `TMapIdentifier`, `TSetIdentifier`, `TStructIdentifier`, `TType`
--> volo-thrift/src/protocol/mod.rs:3:13
|
3 | binary, TFieldIdentifier, TInputProtocol, TLengthProtocol, TListIdentifier, TMapIdentifier,
| ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
4 | TMessageIdentifier, TMessageType, TOutputProtocol, TSetIdentifier, TStructIdentifier, TType,
| ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^
|
unused import: `binary::TBinaryProtocol`:
volo-thrift/src/protocol/mod.rs#L1
warning: unused import: `binary::TBinaryProtocol`
--> volo-thrift/src/protocol/mod.rs:1:9
|
1 | pub use binary::TBinaryProtocol;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
this function can be simplified using the `async fn` syntax:
volo/src/client.rs#L49
warning: this function can be simplified using the `async fn` syntax
--> volo/src/client.rs:49:5
|
49 | / fn call<'cx>(
50 | | self,
51 | | cx: &'cx mut Cx,
52 | | req: Req,
53 | | ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send {
| |_________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
help: make the function `async` and return the output of the future directly
|
49 ~ async fn call<'cx>(
50 + self,
51 + cx: &'cx mut Cx,
52 + req: Req,
53 ~ ) -> Result<Self::Response, Self::Error> {
|
help: move the body of the async block to the enclosing function
|
53 ~ ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send {
54 + self.opt.apply(cx)?;
55 + self.inner.call(cx, req).await
56 + }
|
|
the following explicit lifetimes could be elided: 'cx:
volo/src/client.rs#L49
warning: the following explicit lifetimes could be elided: 'cx
--> volo/src/client.rs:49:13
|
49 | fn call<'cx>(
| ^^^
50 | self,
51 | cx: &'cx mut Cx,
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
49 ~ fn call'_>(
50 | self,
51 ~ cx: &mut Cx,
|
|
the following explicit lifetimes could be elided: 'cx:
volo/src/client.rs#L30
warning: the following explicit lifetimes could be elided: 'cx
--> volo/src/client.rs:30:13
|
30 | fn call<'cx>(
| ^^^
31 | self,
32 | cx: &'cx mut Cx,
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
30 ~ fn call'_>(
31 | self,
32 ~ cx: &mut Cx,
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L415
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:415:17
|
415 | return Err(e);
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
415 - return Err(e);
415 + Err(e)
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L409
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:409:17
|
409 | / return Err(io::Error::new(
410 | | io::ErrorKind::InvalidData,
411 | | "Not PassFdResponse",
412 | | ));
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
409 ~ Err(io::Error::new(
410 + io::ErrorKind::InvalidData,
411 + "Not PassFdResponse",
412 ~ ))
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L406
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:406:17
|
406 | return Ok(Some(fd));
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
406 - return Ok(Some(fd));
406 + Ok(Some(fd))
|
|
useless conversion to the same type: `std::io::Error`:
volo/src/hotrestart/mod.rs#L279
warning: useless conversion to the same type: `std::io::Error`
--> volo/src/hotrestart/mod.rs:279:28
|
279 | return Err(e.into());
| ^^^^^^^^ help: consider removing `.into()`: `e`
|
= 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
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L279
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:279:17
|
279 | return Err(e.into());
| ^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
279 - return Err(e.into());
279 + Err(e.into())
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L274
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:274:25
|
274 | return Err(io::Error::new(io::ErrorKind::InvalidData, e.message));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
274 - return Err(io::Error::new(io::ErrorKind::InvalidData, e.message));
274 + Err(io::Error::new(io::ErrorKind::InvalidData, e.message))
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L270
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:270:29
|
270 | ... return Ok(HotRestartMessage::TerminateParentRequest);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
270 - return Ok(HotRestartMessage::TerminateParentRequest);
270 + Ok(HotRestartMessage::TerminateParentRequest)
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L263
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:263:33
|
263 | / ... return Err(io::Error::new(
264 | | ... io::ErrorKind::InvalidData,
265 | | ... "PassFdResponse without fd",
266 | | ... ));
| |________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
263 ~ Err(io::Error::new(
264 + io::ErrorKind::InvalidData,
265 + "PassFdResponse without fd",
266 ~ ))
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L261
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:261:33
|
261 | ... return Ok(HotRestartMessage::PassFdResponse(fd));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
261 - return Ok(HotRestartMessage::PassFdResponse(fd));
261 + Ok(HotRestartMessage::PassFdResponse(fd))
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L250
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:250:29
|
250 | ... return Ok(HotRestartMessage::PassFdRequest(addr));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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`
|
250 - return Ok(HotRestartMessage::PassFdRequest(addr));
250 + Ok(HotRestartMessage::PassFdRequest(addr))
|
|
you should consider adding a `Default` implementation for `HotRestart`:
volo/src/hotrestart/mod.rs#L107
warning: you should consider adding a `Default` implementation for `HotRestart`
--> volo/src/hotrestart/mod.rs:107:5
|
107 | / pub fn new() -> Self {
108 | | HotRestart {
109 | | state: Arc::new(Mutex::new(HotRestartState::Uninitalized)),
110 | | listener_fds: Arc::new(StdMutex::new(HashMap::new())),
... |
116 | | }
117 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
106 + impl Default for HotRestart {
107 + fn default() -> Self {
108 + Self::new()
109 + }
110 + }
|
|
the borrowed expression implements the required traits:
volo/src/net/incoming.rs#L298
warning: the borrowed expression implements the required traits
--> volo/src/net/incoming.rs:298:34
|
298 | std::fs::remove_file(&path)?;
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
casting to the same type is unnecessary (`i32` -> `i32`):
volo/src/net/incoming.rs#L239
warning: casting to the same type is unnecessary (`i32` -> `i32`)
--> volo/src/net/incoming.rs:239:13
|
239 | libc::SOMAXCONN as i32
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `libc::SOMAXCONN`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`i32` -> `i32`):
volo/src/net/incoming.rs#L229
warning: casting to the same type is unnecessary (`i32` -> `i32`)
--> volo/src/net/incoming.rs:229:20
|
229 | return libc::SOMAXCONN as i32;
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `libc::SOMAXCONN`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`i32` -> `i32`):
volo/src/net/incoming.rs#L222
warning: casting to the same type is unnecessary (`i32` -> `i32`)
--> volo/src/net/incoming.rs:222:30
|
222 | Err(_) => return libc::SOMAXCONN as i32,
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `libc::SOMAXCONN`
|
= 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
|
manual `RangeInclusive::contains` implementation:
volo/src/net/incoming.rs#L156
warning: manual `RangeInclusive::contains` implementation
--> volo/src/net/incoming.rs:156:16
|
156 | if b'0' <= c && c <= b'9' {
| ^^^^^^^^^^^^^^^^^^^^^^ help: use: `(b'0'..=b'9').contains(&c)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
= note: `#[warn(clippy::manual_range_contains)]` on by default
|
this function can be simplified using the `async fn` syntax:
volo/src/loadbalance/layer.rs#L60
warning: this function can be simplified using the `async fn` syntax
--> volo/src/loadbalance/layer.rs:60:5
|
60 | / fn call<'s, 'cx>(
61 | | &'s self,
62 | | cx: &'cx mut Cx,
63 | | req: Req,
64 | | ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send {
| |_________________________________________________________________________^
|
= 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
|
60 ~ async fn call<'s, 'cx>(
61 + &'s self,
62 + cx: &'cx mut Cx,
63 + req: Req,
64 ~ ) -> Result<Self::Response, Self::Error> {
|
help: move the body of the async block to the enclosing function
|
64 ~ ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send {
65 + let callee = cx.rpc_info().callee();
66 +
67 + let picker = match &callee.address {
68 + None => self
69 + .load_balance
70 + .get_picker(callee, &self.discover)
71 + .await
72 + .map_err(|err| err.into())?,
73 + _ => {
74 + return self.service.call(cx, req).await;
75 + }
76 + };
77 + let mut call_count = 0;
78 + for (addr, _) in picker.zip(0..self.retry + 1) {
79 + call_count += 1;
80 + cx.rpc_info_mut().callee_mut().address = Some(addr.clone());
81 +
82 + match self.service.call(cx, req.clone()).await {
83 + Ok(resp) => {
84 + return Ok(resp);
85 + }
86 + Err(err) => {
87 + warn!("[VOLO] call rpcinfo: {:?}, error: {:?}", cx.rpc_info(), err);
88 + if !err.retryable() {
89 + return Err(err);
90 + }
91 + }
92 + }
93 + }
94 + if call_count == 0 {
95 + warn!("[VOLO] zero call count, call rpcinfo: {:?}", cx.rpc_info());
96 + }
97 + Err(LoadBalanceError::Retry.into())
98 + }
|
|
constants have by default a `'static` lifetime:
volo/src/hotrestart/mod.rs#L33
warning: constants have by default a `'static` lifetime
--> volo/src/hotrestart/mod.rs:33:32
|
33 | const HOT_RESTART_CHILD_ADDR: &'static str = "volo_hot_restart_child.sock";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
volo/src/hotrestart/mod.rs#L32
warning: constants have by default a `'static` lifetime
--> volo/src/hotrestart/mod.rs:32:33
|
32 | const HOT_RESTART_PARENT_ADDR: &'static str = "volo_hot_restart_parent.sock";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
|
this function can be simplified using the `async fn` syntax:
volo/src/client.rs#L49
warning: this function can be simplified using the `async fn` syntax
--> volo/src/client.rs:49:5
|
49 | / fn call<'cx>(
50 | | self,
51 | | cx: &'cx mut Cx,
52 | | req: Req,
53 | | ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send {
| |_________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
help: make the function `async` and return the output of the future directly
|
49 ~ async fn call<'cx>(
50 + self,
51 + cx: &'cx mut Cx,
52 + req: Req,
53 ~ ) -> Result<Self::Response, Self::Error> {
|
help: move the body of the async block to the enclosing function
|
53 ~ ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send {
54 + self.opt.apply(cx)?;
55 + self.inner.call(cx, req).await
56 + }
|
|
the following explicit lifetimes could be elided: 'cx:
volo/src/client.rs#L49
warning: the following explicit lifetimes could be elided: 'cx
--> volo/src/client.rs:49:13
|
49 | fn call<'cx>(
| ^^^
50 | self,
51 | cx: &'cx mut Cx,
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
49 ~ fn call'_>(
50 | self,
51 ~ cx: &mut Cx,
|
|
the following explicit lifetimes could be elided: 'cx:
volo/src/client.rs#L30
warning: the following explicit lifetimes could be elided: 'cx
--> volo/src/client.rs:30:13
|
30 | fn call<'cx>(
| ^^^
31 | self,
32 | cx: &'cx mut Cx,
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
30 ~ fn call'_>(
31 | self,
32 ~ cx: &mut Cx,
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L415
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:415:17
|
415 | return Err(e);
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
415 - return Err(e);
415 + Err(e)
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L409
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:409:17
|
409 | / return Err(io::Error::new(
410 | | io::ErrorKind::InvalidData,
411 | | "Not PassFdResponse",
412 | | ));
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
409 ~ Err(io::Error::new(
410 + io::ErrorKind::InvalidData,
411 + "Not PassFdResponse",
412 ~ ))
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L406
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:406:17
|
406 | return Ok(Some(fd));
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
406 - return Ok(Some(fd));
406 + Ok(Some(fd))
|
|
useless conversion to the same type: `std::io::Error`:
volo/src/hotrestart/mod.rs#L279
warning: useless conversion to the same type: `std::io::Error`
--> volo/src/hotrestart/mod.rs:279:28
|
279 | return Err(e.into());
| ^^^^^^^^ help: consider removing `.into()`: `e`
|
= 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
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L279
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:279:17
|
279 | return Err(e.into());
| ^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
279 - return Err(e.into());
279 + Err(e.into())
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L274
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:274:25
|
274 | return Err(io::Error::new(io::ErrorKind::InvalidData, e.message));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
274 - return Err(io::Error::new(io::ErrorKind::InvalidData, e.message));
274 + Err(io::Error::new(io::ErrorKind::InvalidData, e.message))
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L270
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:270:29
|
270 | ... return Ok(HotRestartMessage::TerminateParentRequest);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
270 - return Ok(HotRestartMessage::TerminateParentRequest);
270 + Ok(HotRestartMessage::TerminateParentRequest)
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L263
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:263:33
|
263 | / ... return Err(io::Error::new(
264 | | ... io::ErrorKind::InvalidData,
265 | | ... "PassFdResponse without fd",
266 | | ... ));
| |________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
263 ~ Err(io::Error::new(
264 + io::ErrorKind::InvalidData,
265 + "PassFdResponse without fd",
266 ~ ))
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L261
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:261:33
|
261 | ... return Ok(HotRestartMessage::PassFdResponse(fd));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
261 - return Ok(HotRestartMessage::PassFdResponse(fd));
261 + Ok(HotRestartMessage::PassFdResponse(fd))
|
|
unneeded `return` statement:
volo/src/hotrestart/mod.rs#L250
warning: unneeded `return` statement
--> volo/src/hotrestart/mod.rs:250:29
|
250 | ... return Ok(HotRestartMessage::PassFdRequest(addr));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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`
|
250 - return Ok(HotRestartMessage::PassFdRequest(addr));
250 + Ok(HotRestartMessage::PassFdRequest(addr))
|
|
you should consider adding a `Default` implementation for `HotRestart`:
volo/src/hotrestart/mod.rs#L107
warning: you should consider adding a `Default` implementation for `HotRestart`
--> volo/src/hotrestart/mod.rs:107:5
|
107 | / pub fn new() -> Self {
108 | | HotRestart {
109 | | state: Arc::new(Mutex::new(HotRestartState::Uninitalized)),
110 | | listener_fds: Arc::new(StdMutex::new(HashMap::new())),
... |
116 | | }
117 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
106 + impl Default for HotRestart {
107 + fn default() -> Self {
108 + Self::new()
109 + }
110 + }
|
|
the borrowed expression implements the required traits:
volo/src/net/incoming.rs#L298
warning: the borrowed expression implements the required traits
--> volo/src/net/incoming.rs:298:34
|
298 | std::fs::remove_file(&path)?;
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
casting to the same type is unnecessary (`i32` -> `i32`):
volo/src/net/incoming.rs#L239
warning: casting to the same type is unnecessary (`i32` -> `i32`)
--> volo/src/net/incoming.rs:239:13
|
239 | libc::SOMAXCONN as i32
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `libc::SOMAXCONN`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`i32` -> `i32`):
volo/src/net/incoming.rs#L229
warning: casting to the same type is unnecessary (`i32` -> `i32`)
--> volo/src/net/incoming.rs:229:20
|
229 | return libc::SOMAXCONN as i32;
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `libc::SOMAXCONN`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`i32` -> `i32`):
volo/src/net/incoming.rs#L222
warning: casting to the same type is unnecessary (`i32` -> `i32`)
--> volo/src/net/incoming.rs:222:30
|
222 | Err(_) => return libc::SOMAXCONN as i32,
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `libc::SOMAXCONN`
|
= 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
|
manual `RangeInclusive::contains` implementation:
volo/src/net/incoming.rs#L156
warning: manual `RangeInclusive::contains` implementation
--> volo/src/net/incoming.rs:156:16
|
156 | if b'0' <= c && c <= b'9' {
| ^^^^^^^^^^^^^^^^^^^^^^ help: use: `(b'0'..=b'9').contains(&c)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
= note: `#[warn(clippy::manual_range_contains)]` on by default
|
this function can be simplified using the `async fn` syntax:
volo/src/loadbalance/layer.rs#L60
warning: this function can be simplified using the `async fn` syntax
--> volo/src/loadbalance/layer.rs:60:5
|
60 | / fn call<'s, 'cx>(
61 | | &'s self,
62 | | cx: &'cx mut Cx,
63 | | req: Req,
64 | | ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send {
| |_________________________________________________________________________^
|
= 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
|
60 ~ async fn call<'s, 'cx>(
61 + &'s self,
62 + cx: &'cx mut Cx,
63 + req: Req,
64 ~ ) -> Result<Self::Response, Self::Error> {
|
help: move the body of the async block to the enclosing function
|
64 ~ ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send {
65 + let callee = cx.rpc_info().callee();
66 +
67 + let picker = match &callee.address {
68 + None => self
69 + .load_balance
70 + .get_picker(callee, &self.discover)
71 + .await
72 + .map_err(|err| err.into())?,
73 + _ => {
74 + return self.service.call(cx, req).await;
75 + }
76 + };
77 + let mut call_count = 0;
78 + for (addr, _) in picker.zip(0..self.retry + 1) {
79 + call_count += 1;
80 + cx.rpc_info_mut().callee_mut().address = Some(addr.clone());
81 +
82 + match self.service.call(cx, req.clone()).await {
83 + Ok(resp) => {
84 + return Ok(resp);
85 + }
86 + Err(err) => {
87 + warn!("[VOLO] call rpcinfo: {:?}, error: {:?}", cx.rpc_info(), err);
88 + if !err.retryable() {
89 + return Err(err);
90 + }
91 + }
92 + }
93 + }
94 + if call_count == 0 {
95 + warn!("[VOLO] zero call count, call rpcinfo: {:?}", cx.rpc_info());
96 + }
97 + Err(LoadBalanceError::Retry.into())
98 + }
|
|
constants have by default a `'static` lifetime:
volo/src/hotrestart/mod.rs#L33
warning: constants have by default a `'static` lifetime
--> volo/src/hotrestart/mod.rs:33:32
|
33 | const HOT_RESTART_CHILD_ADDR: &'static str = "volo_hot_restart_child.sock";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
volo/src/hotrestart/mod.rs#L32
warning: constants have by default a `'static` lifetime
--> volo/src/hotrestart/mod.rs:32:33
|
32 | const HOT_RESTART_PARENT_ADDR: &'static str = "volo_hot_restart_parent.sock";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
|
lint
The following actions uses node12 which is deprecated and will be forced to run on node16: 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/
|
test-macos
The following actions uses node12 which is deprecated and will be forced to run on node16: Swatinem/rust-cache@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
test-macos
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/
|
test-macos
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/
|
test-macos
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/
|
test-windows
The following actions uses node12 which is deprecated and will be forced to run on node16: Swatinem/rust-cache@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
test-windows
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/
|
test-windows
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/
|
test-windows
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/
|