cloudflare / foundations

Cloudflare's Rust service foundations library.
https://blog.cloudflare.com/introducing-foundations-our-open-source-rust-service-foundation-library
BSD 3-Clause "New" or "Revised" License
1.24k stars 50 forks source link

Rust 1.79 clippy failing due to possible code simplification in darling's proc macro usage #50

Closed nmldiegues closed 1 month ago

nmldiegues commented 2 months ago

foundations' CI is failing the clippy check with:

error: if let can be simplified with `.unwrap_or_default()`
  --> foundations-macros/src/info_metric/mod.rs:18:15
   |
18 |     #[darling(default)]
   |               ^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
   = note: `-D clippy::manual-unwrap-or-default` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_unwrap_or_default)]`

This has been reported in darling's repo https://github.com/TedDriggs/darling/issues/293 but is still not fixed there. So right now foundations development is stuck.

nmldiegues commented 2 months ago

Temporary mitigation until this is fixed properly: https://github.com/cloudflare/foundations/pull/51

TedDriggs commented 1 month ago

This has been fixed in darling 0.20.10

inikulin commented 1 month ago

@TedDriggs thank you for the heads up

inikulin commented 1 month ago

Ah, we can't easily update - we're still on syn 1.x

inikulin commented 1 month ago

Ok, wasn't that hard after all: https://github.com/cloudflare/foundations/pull/56