Skip to content

Commit

Permalink
chore: fix non_snake_case rust-analyzer warning (#4689)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Sep 21, 2023
1 parent 6d3e229 commit cf5d0e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/storage/codecs/derive/src/compact/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ pub(crate) fn generate_flag_struct(

// Generate the flag struct.
quote! {

pub use #mod_flags_ident::#flags_ident;
#[allow(non_snake_case)]
mod #mod_flags_ident {
use bytes::Buf;
use modular_bitfield::prelude::*;
Expand Down
1 change: 1 addition & 0 deletions crates/storage/codecs/derive/src/compact/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ mod tests {
// Expected output in a TokenStream format. Commas matter!
let should_output = quote! {
pub use TestStruct_flags::TestStructFlags;
#[allow(non_snake_case)]
mod TestStruct_flags {
use bytes::Buf;
use modular_bitfield::prelude::*;
Expand Down
12 changes: 4 additions & 8 deletions crates/transaction-pool/src/test_utils/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,21 @@ macro_rules! get_value {
// Generates all setters and getters
macro_rules! make_setters_getters {
($($name:ident => $t:ty);*) => {
paste! {
$(
paste! {$(
pub fn [<set_ $name>](&mut self, $name: $t) -> &mut Self {
set_value!(self => $name);
self
}

pub fn [<with_$name>](mut self, $name: $t) -> Self {
pub fn [<with_ $name>](mut self, $name: $t) -> Self {
set_value!(self => $name);
self
}

pub fn [<get_$name>](&self) -> $t {
pub fn [<get_ $name>](&self) -> $t {
get_value!(self => $name).clone()
}

)*

}
)*}
};
}

Expand Down

0 comments on commit cf5d0e2

Please sign in to comment.