lit-robotics / libcamera-rs

Experimental Rust bindings for libcamera
Apache License 2.0
46 stars 15 forks source link

Add `clippy` to CI #8

Closed mfreeborn closed 1 year ago

mfreeborn commented 1 year ago

Clippy reports just over 20 misdemeanours at present, include one that it marks as an error:

error: offset calculation on zero-sized value
   --> libcamera-rs/src/framebuffer.rs:207:34
    |
207 |                     NonNull::new(libcamera_framebuffer_planes_data(self.ptr.as_ptr()).offset(index as _)).unwrap(),
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zst_offset
    = note: `#[deny(clippy::zst_offset)]` on by default

I wonder if it would be agreeable to add a CI job that fails on clippy warnings.

chemicstry commented 1 year ago

Thanks for reporting this, I always forget to run clippy... Fixed all warnings in #11, and we will add it to CI in #7