ethercrab-rs / ethercrab

EtherCAT master written in pure Rust
258 stars 24 forks source link

Remove a bunch of panicking indexing operations #222

Closed jamwaffles closed 4 months ago

jamwaffles commented 4 months ago

Discovered and fixed by temporarily adding #![deny(clippy::indexing_slicing)] (https://rust-lang.github.io/rust-clippy/master/index.html#/indexing_slicing). Allows more graceful error handling.

Slight binary size reduction:

master

   text    data     bss     dec     hex filename
  89768     112   57288  147168   23ee0 ethercrab-stm32-embassy

This branch:

   text    data     bss     dec     hex filename
  88800     112   57288  146200   23b18 ethercrab-stm32-embassy

Performance is unchanged.

Also added a few general clippy fixes to this PR.