Skip to content

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

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

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

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

reviewdog [clippy (libcoap-sys)] report

reported by reviewdog 🐶

Findings (2)

libcoap-sys/build.rs|221 col 52| warning: use of format! to build up a string from an iterator
--> libcoap-sys/build.rs:221:52
|
221 | ... 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:221:74
|
221 | ... 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:221:82
|
221 | ... 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|223 col 68| warning: use of format! to build up a string from an iterator
--> libcoap-sys/build.rs:223:68
|
223 | ... build_config.env("MbedTLS_CFLAGS", lib.link_paths.iter().map(|x| format!("-I{}", x.display())).collect::());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: call fold instead
--> libcoap-sys/build.rs:223:90
|
223 | ... 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:223:98
|
223 | ... 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|389 col 77| warning: use of deprecated constant bindgen::CargoCallbacks: Use CargoCallbacks::new() instead. Please, check the documentation for further information.
--> libcoap-sys/build.rs:389:77
|
389 | 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|287 col 61| warning: use of unwrap_or_else to construct default value
--> libcoap-sys/build.rs:287:61
|
287 | 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|287 col 17| warning: this call to as_ref.map(...) does nothing
--> libcoap-sys/build.rs:287:17
|
287 | 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 221 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#L221

warning: use of `format!` to build up a string from an iterator
   --> libcoap-sys/build.rs:221:52
    |
221 | ...                   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:221:74
    |
221 | ...                   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:221:82
    |
221 | ...                   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:221:52:w:warning: use of `format!` to build up a string from an iterator
   --> libcoap-sys/build.rs:221:52
    |
221 | ...                   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:221:74
    |
221 | ...                   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:221:82
    |
221 | ...                   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 223 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#L223

warning: use of `format!` to build up a string from an iterator
   --> libcoap-sys/build.rs:223:68
    |
223 | ...                   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:223:90
    |
223 | ...                   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:223:98
    |
223 | ...                   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:223:68:w:warning: use of `format!` to build up a string from an iterator
   --> libcoap-sys/build.rs:223:68
    |
223 | ...                   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:223:90
    |
223 | ...                   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:223:98
    |
223 | ...                   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__