Add compile-time and runtime checks for feature availability #146
reviewdog [clippy (libcoap-rs)] report
reported by reviewdog 🐶
Findings (0)
Filtered Findings (7)
libcoap/src/context.rs|608 col 11| warning: unneeded sub cfg
when there is only one condition
--> libcoap/src/context.rs:608:11
|
608 | #[cfg(all(feature = "dtls"))]
| ^^^^^^^^^^^^^^^^^^^^^ help: try: feature = "dtls"
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
= note: #[warn(clippy::non_minimal_cfg)]
on by default
libcoap/src/resource.rs|104 col 11| warning: methods uri_path
and as_any
are never used
--> libcoap/src/resource.rs:106:8
|
104 | pub trait UntypedCoapResource: Any + Debug {
| ------------------- methods in this trait
105 | /// Returns the uri_path this resource responds to.
106 | fn uri_path(&self) -> &str;
| ^^^^^^^^
...
113 | fn as_any(&self) -> &dyn Any;
| ^^^^^^
|
= note: #[warn(dead_code)]
on by default
libcoap/src/context.rs|120 col 17| warning: useless conversion to the same type: u32
--> libcoap/src/context.rs:120:17
|
120 | / (COAP_BLOCK_USE_LIBCOAP | COAP_BLOCK_SINGLE_BODY)
121 | | .try_into()
| |____________^
|
= help: consider removing .try_into()
= 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
libcoap/src/crypto.rs|145 col 53| warning: unnecessary map of the identity function
--> libcoap/src/crypto.rs:145:53
|
145 | .provide_raw_key_for_hint(provided_identity)
| _____________________________________________________^
146 | | .map(|v| v)
| |^ help: remove the call to map
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity
= note: #[warn(clippy::map_identity)]
on by default
libcoap/src/crypto.rs|179 col 49| warning: unnecessary map of the identity function
--> libcoap/src/crypto.rs:179:49
|
179 | .provide_raw_hint_for_sni(sni_value)
| ________________________^
180 | | .map(|v| (v))
| |^ help: remove the call to map
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity
libcoap/src/session/client.rs|152 col 17| warning: casting raw pointers to the same type and constness is unnecessary (*mut libcoap_sys::coap_session_t
-> *mut libcoap_sys::coap_session_t
)
--> libcoap/src/session/client.rs:152:17
|
152 | session as *mut coap_session_t,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: session
|
= 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
libcoap/src/session/client.rs|186 col 17| warning: casting raw pointers to the same type and constness is unnecessary (*mut libcoap_sys::coap_session_t
-> *mut libcoap_sys::coap_session_t
)
--> libcoap/src/session/client.rs:186:17
|
186 | session as *mut coap_session_t,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: session
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast