RSDK-4755: accept entity string for rpc dial (#75) #355
clippy
28 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 28 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.72.0 (5680fa18f 2023-08-23)
- cargo 1.72.0 (103a7ff2e 2023-08-15)
- clippy 0.1.72 (5680fa1 2023-08-23)
Annotations
Check warning on line 277 in src/dialdbg/main.rs
github-actions / clippy
redundant pattern matching, consider using `is_ok()`
warning: redundant pattern matching, consider using `is_ok()`
--> src/dialdbg/main.rs:277:16
|
277 | if let Ok(_) = log_path.try_exists() {
| -------^^^^^------------------------ help: try this: `if log_path.try_exists().is_ok()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
Check warning on line 223 in src/dialdbg/main.rs
github-actions / clippy
redundant pattern matching, consider using `is_ok()`
warning: redundant pattern matching, consider using `is_ok()`
--> src/dialdbg/main.rs:223:16
|
223 | if let Ok(_) = log_path.try_exists() {
| -------^^^^^------------------------ help: try this: `if log_path.try_exists().is_ok()`
|
= 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 131 in src/dialdbg/main.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/dialdbg/main.rs:131:8
|
131 | if responses.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `responses.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
Check warning on line 13 in src/dialdbg/stats.rs
github-actions / clippy
you seem to want to iterate on a map's values
warning: you seem to want to iterate on a map's values
--> src/dialdbg/stats.rs:13:27
|
13 | for (_, value) in &self.0.reports {
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map
= note: `#[warn(clippy::for_kv_map)]` on by default
help: use the corresponding method
|
13 | for value in self.0.reports.values() {
| ~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
Check warning on line 159 in src/dialdbg/parse.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/dialdbg/parse.rs:159:8
|
159 | if split_log.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `split_log.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 10 in src/dialdbg/parse.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/dialdbg/parse.rs:10:38
|
10 | pub(crate) const DIAL_ERROR_PREFIX: &'static str = "unexpected dial connect error";
| -^^^^^^^---- 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
Check warning on line 353 in src/rpc/webrtc.rs
github-actions / clippy
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> src/rpc/webrtc.rs:346:5
|
346 | / match proto.status {
347 | | Some(ref status) => {
348 | | let key = HeaderName::from_str("Grpc-Message").unwrap();
349 | | let val = HeaderValue::from_str(&status.message).unwrap();
... |
352 | | None => (),
353 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try this
|
346 ~ if let Some(ref status) = proto.status {
347 + let key = HeaderName::from_str("Grpc-Message").unwrap();
348 + let val = HeaderValue::from_str(&status.message).unwrap();
349 + trailers.insert(key, val);
350 + }
|
Check warning on line 604 in src/rpc/dial.rs
github-actions / clippy
using `clone` on type `Option<&Authority>` which implements the `Copy` trait
warning: using `clone` on type `Option<&Authority>` which implements the `Copy` trait
--> src/rpc/dial.rs:604:22
|
604 | let domain = original_uri.authority().clone().unwrap().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `original_uri.authority()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Check warning on line 519 in src/rpc/dial.rs
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/rpc/dial.rs:519:67
|
519 | Self::create_channel(self.config.allow_downgrade, &domain, uri.clone(), false)
| ^^^^^^^ help: change this to: `domain`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 501 in src/rpc/dial.rs
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/rpc/dial.rs:501:67
|
501 | Self::create_channel(self.config.allow_downgrade, &domain, uri, true).await
| ^^^^^^^ help: change this to: `domain`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 404 in src/rpc/dial.rs
github-actions / clippy
single-character string constant used as pattern
warning: single-character string constant used as pattern
--> src/rpc/dial.rs:404:62
|
404 | let candidates: Vec<String> = vec![candidate.replace(".", "-"), candidate];
| ^^^ help: try using a `char` instead: `'.'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: `#[warn(clippy::single_char_pattern)]` on by default
Check warning on line 323 in src/rpc/dial.rs
github-actions / clippy
using `clone` on type `Ipv4Addr` which implements the `Copy` trait
warning: using `clone` on type `Ipv4Addr` which implements the `Copy` trait
--> src/rpc/dial.rs:323:48
|
323 | IpAddr::V4(v4) => Some(v4.clone()),
| ^^^^^^^^^^ help: try removing the `clone` call: `v4`
|
= 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
Check warning on line 326 in src/rpc/dial.rs
github-actions / clippy
called `map(..).flatten()` on `Option`
warning: called `map(..).flatten()` on `Option`
--> src/rpc/dial.rs:322:22
|
322 | .map(|ip| match ip.ip() {
| ______________________^
323 | | IpAddr::V4(v4) => Some(v4.clone()),
324 | | IpAddr::V6(_) => None,
325 | | })
326 | | .flatten()
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
help: try replacing `map` with `and_then` and remove the `.flatten()`
|
322 ~ .and_then(|ip| match ip.ip() {
323 + IpAddr::V4(v4) => Some(v4.clone()),
324 + IpAddr::V6(_) => None,
325 + })
|
Check warning on line 114 in src/rpc/client_stream.rs
github-actions / clippy
passing a unit value to a function
warning: passing a unit value to a function
--> src/rpc/client_stream.rs:114:47
|
114 | Some(Type::Trailers(trailers)) => Ok(self.process_trailers(trailers.to_owned()).await),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
= note: `#[warn(clippy::unit_arg)]` on by default
help: move the expression in front of the call and replace it with the unit literal `()`
|
114 ~ Some(Type::Trailers(trailers)) => {
115 + self.process_trailers(trailers.to_owned()).await;
116 + Ok(())
117 ~ },
|
Check warning on line 275 in src/ffi/spatialmath/quaternion.rs
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/ffi/spatialmath/quaternion.rs:275:20
|
275 | to_raw_pointer(&quat)
| ^^^^^ help: change this to: `quat`
|
= 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
Check warning on line 254 in src/ffi/dial_ffi.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/ffi/dial_ffi.rs:252:5
|
252 | / let _ = runtime.spawn(async {
253 | | let _ = server.await;
254 | | });
| |_______^
|
= 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 22 in src/rpc/log_prefixes.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/rpc/log_prefixes.rs:22:34
|
22 | pub const ICE_CONNECTED_EXTERN: &'static str = "ICE connection state changed: connected";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
Check warning on line 18 in src/rpc/log_prefixes.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/rpc/log_prefixes.rs:18:32
|
18 | pub const CANDIDATE_SELECTED: &'static str = "Selected candidate pair";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
Check warning on line 16 in src/rpc/log_prefixes.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/rpc/log_prefixes.rs:16:27
|
16 | pub const DIALED_WEBRTC: &'static str = "Connected via WebRTC";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
Check warning on line 15 in src/rpc/log_prefixes.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/rpc/log_prefixes.rs:15:25
|
15 | pub const DIALED_GRPC: &'static str = "Connected via gRPC";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
Check warning on line 14 in src/rpc/log_prefixes.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/rpc/log_prefixes.rs:14:26
|
14 | pub const DIAL_ATTEMPT: &'static str = "Dialing";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
Check warning on line 12 in src/rpc/log_prefixes.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/rpc/log_prefixes.rs:12:43
|
12 | pub const END_LOCAL_SESSION_DESCRIPTION: &'static str = "End local session description";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
Check warning on line 11 in src/rpc/log_prefixes.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/rpc/log_prefixes.rs:11:45
|
11 | pub const START_LOCAL_SESSION_DESCRIPTION: &'static str = "Start local session description";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
Check warning on line 9 in src/rpc/log_prefixes.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/rpc/log_prefixes.rs:9:33
|
9 | pub const ACQUIRED_AUTH_TOKEN: &'static str = "Acquired auth token";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
Check warning on line 8 in src/rpc/log_prefixes.rs
github-actions / clippy
constants have by default a `'static` lifetime
warning: constants have by default a `'static` lifetime
--> src/rpc/log_prefixes.rs:8:34
|
8 | pub const ACQUIRING_AUTH_TOKEN: &'static str = "Acquiring auth token";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes