openwsn-berkeley / lakers

EDHOC implemented in Rust, optimized for microcontrollers, with bindings for C and Python.
https://crates.io/crates/lakers
BSD 3-Clause "New" or "Revised" License
12 stars 10 forks source link

refactor: Apply fixes where clippy complains #154

Closed chrysn closed 7 months ago

chrysn commented 7 months ago

This contains some automatically applied and some manual changes.

For the manual changes, the "use map instead of" commit is a test balloon for the translation of more functional style programming. A previous iteration in #151 did not work -- but there, a mut was (needlessly -- that part was not refactored to see what hacspec can do) accessed from the map closure while living in the outer function.

Replaces: https://github.com/openwsn-berkeley/edhoc-rs/pull/151

geonnave commented 7 months ago

Thanks for updating this PR. It passes fstar generation.

geonnave commented 7 months ago

Thanks for updating this PR. It passes fstar generation.

There is one conflict at edhoc.rs:915 and it is easy to fix, I am pushing it.

P.S.: I tried to push the conflict solution with git push chrysn chrysn/clippy-fixes-2 but seems to not have worked.

chrysn commented 7 months ago

Now processed to the point where all the remaining clippy warnings are either style things (I'm running with -allow clippy::manual_range_contains --allow clippy::absurd_extreme_comparisons because it's more a matter of taste), or possible hints at trouble in the code (the mut kid assignment), or other style things, or need actual decisions taken (return types and signatures).