Skip to content

Update libcoap to 4.3.5, bump dependencies, improve linking (incl. ESP32) #73

Update libcoap to 4.3.5, bump dependencies, improve linking (incl. ESP32)

Update libcoap to 4.3.5, bump dependencies, improve linking (incl. ESP32) #73

GitHub Actions / clippy (libcoap-sys) completed Jun 13, 2024 in 0s

reviewdog [clippy (libcoap-sys)] report

reported by reviewdog 🐶

Findings (2)

libcoap-sys/build.rs|218 col 52| warning: use of format! to build up a string from an iterator
--> libcoap-sys/build.rs:218:52
|
218 | ... lib_flags.push_str(lib.link_paths.iter().map(|x| format!("-L{} ", x.display())).collect::().as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: call fold instead
--> libcoap-sys/build.rs:218:74
|
218 | ... lib_flags.push_str(lib.link_paths.iter().map(|x| format!("-L{} ", x.display())).collect::().as_str());
| ^^^
help: ... and use the write! macro here
--> libcoap-sys/build.rs:218:82
|
218 | ... lib_flags.push_str(lib.link_paths.iter().map(|x| format!("-L{} ", x.display())).collect::().as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this can be written more efficiently by appending to a String directly
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_collect
= note: #[warn(clippy::format_collect)] on by default
libcoap-sys/build.rs|220 col 68| warning: use of format! to build up a string from an iterator
--> libcoap-sys/build.rs:220:68
|
220 | ... build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: call fold instead
--> libcoap-sys/build.rs:220:90
|
220 | ... build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::());
| ^^^
help: ... and use the write! macro here
--> libcoap-sys/build.rs:220:98
|
220 | ... build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this can be written more efficiently by appending to a String directly
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_collect

Filtered Findings (4)

libcoap-sys/build.rs|386 col 77| warning: use of deprecated constant bindgen::CargoCallbacks: Use CargoCallbacks::new() instead. Please, check the documentation for further information.
--> libcoap-sys/build.rs:386:77
|
386 | bindgen_builder = bindgen_builder.parse_callbacks(Box::new(bindgen::CargoCallbacks));
| ^^^^^^^^^^^^^^
|
= note: #[warn(deprecated)] on by default
libcoap-sys/build.rs|28 col 1| warning: direct implementation of ToString
--> libcoap-sys/build.rs:28:1
|
28 | / impl ToString for DtlsBackend {
29 | | fn to_string(&self) -> String {
30 | | match self {
31 | | DtlsBackend::GnuTls => "gnutls",
... |
37 | | }
38 | | }
| |_^
|
= help: prefer implementing Display instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
= note: #[warn(clippy::to_string_trait_impl)] on by default
libcoap-sys/build.rs|284 col 61| warning: use of unwrap_or_else to construct default value
--> libcoap-sys/build.rs:284:61
|
284 | orig_pkg_config.as_ref().map(String::clone).unwrap_or_else(String::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
libcoap-sys/build.rs|284 col 17| warning: this call to as_ref.map(...) does nothing
--> libcoap-sys/build.rs:284:17
|
284 | orig_pkg_config.as_ref().map(String::clone).unwrap_or_else(String::new)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: orig_pkg_config.clone()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
= note: #[warn(clippy::useless_asref)] on by default

Annotations

Check warning on line 218 in libcoap-sys/build.rs

See this annotation in the file changed.

@github-actions github-actions / clippy (libcoap-sys)

[clippy (libcoap-sys)] libcoap-sys/build.rs#L218

warning: use of `format!` to build up a string from an iterator
   --> libcoap-sys/build.rs:218:52
    |
218 | ...                   lib_flags.push_str(lib.link_paths.iter().map(|x| format!("-L{} ", x.display())).collect::<String>().as_str());
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
help: call `fold` instead
   --> libcoap-sys/build.rs:218:74
    |
218 | ...                   lib_flags.push_str(lib.link_paths.iter().map(|x| format!("-L{} ", x.display())).collect::<String>().as_str());
    |                                                                ^^^
help: ... and use the `write!` macro here
   --> libcoap-sys/build.rs:218:82
    |
218 | ...                   lib_flags.push_str(lib.link_paths.iter().map(|x| format!("-L{} ", x.display())).collect::<String>().as_str());
    |                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this can be written more efficiently by appending to a `String` directly
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_collect
    = note: `#[warn(clippy::format_collect)]` on by default
Raw output
libcoap-sys/build.rs:218:52:w:warning: use of `format!` to build up a string from an iterator
   --> libcoap-sys/build.rs:218:52
    |
218 | ...                   lib_flags.push_str(lib.link_paths.iter().map(|x| format!("-L{} ", x.display())).collect::<String>().as_str());
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
help: call `fold` instead
   --> libcoap-sys/build.rs:218:74
    |
218 | ...                   lib_flags.push_str(lib.link_paths.iter().map(|x| format!("-L{} ", x.display())).collect::<String>().as_str());
    |                                                                ^^^
help: ... and use the `write!` macro here
   --> libcoap-sys/build.rs:218:82
    |
218 | ...                   lib_flags.push_str(lib.link_paths.iter().map(|x| format!("-L{} ", x.display())).collect::<String>().as_str());
    |                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this can be written more efficiently by appending to a `String` directly
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_collect
    = note: `#[warn(clippy::format_collect)]` on by default


__END__

Check warning on line 220 in libcoap-sys/build.rs

See this annotation in the file changed.

@github-actions github-actions / clippy (libcoap-sys)

[clippy (libcoap-sys)] libcoap-sys/build.rs#L220

warning: use of `format!` to build up a string from an iterator
   --> libcoap-sys/build.rs:220:68
    |
220 | ...                   build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::<String>());
    |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
help: call `fold` instead
   --> libcoap-sys/build.rs:220:90
    |
220 | ...                   build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::<String>());
    |                                                                                ^^^
help: ... and use the `write!` macro here
   --> libcoap-sys/build.rs:220:98
    |
220 | ...                   build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::<String>());
    |                                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this can be written more efficiently by appending to a `String` directly
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_collect
Raw output
libcoap-sys/build.rs:220:68:w:warning: use of `format!` to build up a string from an iterator
   --> libcoap-sys/build.rs:220:68
    |
220 | ...                   build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::<String>());
    |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
help: call `fold` instead
   --> libcoap-sys/build.rs:220:90
    |
220 | ...                   build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::<String>());
    |                                                                                ^^^
help: ... and use the `write!` macro here
   --> libcoap-sys/build.rs:220:98
    |
220 | ...                   build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::<String>());
    |                                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this can be written more efficiently by appending to a `String` directly
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_collect


__END__