Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few clippy fixes #381

Merged
merged 1 commit into from
Sep 27, 2024
Merged

A few clippy fixes #381

merged 1 commit into from
Sep 27, 2024

Conversation

zhassan-aws
Copy link
Contributor

A few minor clippy fixes found while integrating with Kani (model-checking/kani#3514):

$ cargo clippy --all -- -D warnings 
   Compiling serde_derive v1.0.210
   Compiling zerocopy-derive v0.7.35
   Compiling tracing-attributes v0.1.27
   Compiling thiserror-impl v1.0.64
   Compiling strum_macros v0.26.4
   Compiling clap_derive v4.5.18
   Compiling kani_macros v0.55.0 (/home/ubuntu/git/kani/library/kani_macros)
   Compiling macros v0.1.0 (/home/ubuntu/git/kani/charon/charon/macros)
error: you seem to use `.enumerate()` and immediately discard the index
  --> charon/charon/macros/src/enum_helpers.rs:22:19
   |
22 |     for (_, c) in s.chars().enumerate() {
   |                   ^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index
   = note: `-D clippy::unused-enumerate-index` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::unused_enumerate_index)]`
help: remove the `.enumerate()` call
   |
22 |     for c in s.chars() {
   |         ~    ~~~~~~~~~

error: first doc comment paragraph is too long
  --> charon/charon/macros/src/lib.rs:28:1
   |
28 | / /// Macro `EnumIsA`
29 | | /// Derives functions of the form `fn is_{variant_name}(&self) -> bool` returning true
30 | | /// if an enumeration instance is of some variant. For lists, it would generate
31 | | /// `is_cons` and `is_nil`.
...  |
35 | | /// dead (a PR from 2019 has never been merged), so it seems better to maintain
36 | | /// our own code here (which is small) rather than doing PRs for this crate.
   | |_
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
   = note: `-D clippy::too-long-first-doc-paragraph` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`

error: first doc comment paragraph is too long
  --> charon/charon/macros/src/lib.rs:42:1
   |
42 | / /// Macro `EnumAsGetters`
43 | | /// Derives functions of the form `fn as_{variant_name}(&self) -> ...` checking
44 | | /// that an enumeration instance is of the proper variant and returning shared
45 | | /// borrows to its fields.
46 | | /// Also see the comments for [crate::derive_enum_is_a]
   | |_
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph

error: first doc comment paragraph is too long
  --> charon/charon/macros/src/lib.rs:61:1
   |
61 | / /// Macro `EnumToGetters`
62 | | /// Derives functions of the form `fn to_{variant_name}(self) -> ...` checking
63 | | /// that an enumeration instance is of the proper variant and returning its
64 | | /// fields (while consuming the instance).
65 | | /// Also see the comments for [crate::derive_enum_is_a]
   | |_
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph

error: could not compile `macros` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `macros` (lib) due to 4 previous errors

@Nadrieril
Copy link
Member

👍

@Nadrieril Nadrieril merged commit fa0ab32 into AeneasVerif:main Sep 27, 2024
5 of 6 checks passed
@zhassan-aws zhassan-aws deleted the clippy-fixes branch September 27, 2024 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants