eclipse-iceoryx / iceoryx2

Eclipse iceoryx2™ - true zero-copy inter-process-communication in pure Rust
https://iceoryx.io
Apache License 2.0
1.03k stars 40 forks source link

FIx Cargo Clippy Warnings #430

Open xieyuschen opened 1 month ago

xieyuschen commented 1 month ago

Currently, cargo clippy under the root returns many warnings about the project, I propose we can follow the suggestions from rust clippy and resolve them.

Many comments violate the first doc comment paragraph is too long rules because they don't have a short and brief introduction as the first doc comment.

I plan to fix them gradually, on the way of learning and understanding more about iceoryx2 codebase. Moreover, I will try to put the doc fixing in separated PRs for better reviewing(it may take efforts for reviewing because of the in-accurate statements).

elfenpiff commented 1 month ago

@xieyuschen Thanks for opening the issue. Could you share the cargo clippy command you used to receive those warnings? I am asking since when I run cargo clippy from main I got no warnings at all.

xieyuschen commented 1 month ago

@xieyuschen Thanks for opening the issue. Could you share the cargo clippy command you used to receive those warnings? I am asking since when I run cargo clippy from main I got no warnings at all.

@elfenpiff only put a part of the output of cargo clippy.

➜  iceoryx2 git:(main) cargo --version       
cargo 1.83.0-nightly (80d82ca22 2024-09-27)
➜  iceoryx2 git:(main) cargo clippy --version
clippy 0.1.83 (06bb8364 2024-10-01)
➜  iceoryx2 git:(main) git rev-parse HEAD
6d25b61fd679e94044f6142e8af5b2106bf8facf

➜  iceoryx2 git:(main) cargo clippy
warning: first doc comment paragraph is too long
   --> iceoryx2-pal/concurrency-sync/src/iox_atomic.rs:134:1
    |
134 | / /// iceoryx2 implementation of an atomic that has an internal [`RwLockWriterPreference`].
135 | | /// It enables atomic operations on platforms that do not support them with the restriction that
136 | | /// those operations are no longer lock-free.
    | |_
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
    = note: `#[warn(clippy::too_long_first_doc_paragraph)]` on by default
help: add an empty line
...
elfenpiff commented 1 month ago

@xieyuschen Thanks, you reminded me that I need to call rustup update again ;)