Skip to content

Commit

Permalink
Fix non_snake_case warning on generated identity functions (#891)
Browse files Browse the repository at this point in the history
The `Message` derive macro currently generates `Debug` implementations
that contain code that violates the `non_snake_case` linter rule[^1].

This commit changes the macro expansion to add an `#[allow(...)]`
attribute for this rule.

[^1]: https://doc.rust-lang.org/stable/nightly-rustc/rustc_lint/nonstandard_style/static.NON_SNAKE_CASE.html

Co-authored-by: Lucio Franco <[email protected]>
  • Loading branch information
aalexandrov and LucioFranco authored Aug 14, 2023
1 parent 80fb9d1 commit 65451cc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions prost-derive/src/field/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ impl Field {
}
} else {
quote! {
#[allow(non_snake_case)]
fn #wrap_name<T>(v: T) -> T { v }
}
}
Expand Down

0 comments on commit 65451cc

Please sign in to comment.