Skip to content

Commit

Permalink
Updates for new lints
Browse files Browse the repository at this point in the history
  • Loading branch information
csnover committed Jan 6, 2024
1 parent 6507d4c commit e96a132
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
9 changes: 5 additions & 4 deletions binrw/tests/dbg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
fn dbg() {
use binrw::{io::Cursor, BinRead};

#[allow(dead_code)]
#[derive(BinRead, Debug)]
struct Inner(u32);

Expand Down Expand Up @@ -56,10 +57,10 @@ fn dbg() {
"[{file}:{offset_3} | offset 0x14] terminator = 0x69\n",
),
file = core::file!(),
offset_0 = if cfg!(nightly) { 15 } else { 10 },
offset_1 = if cfg!(nightly) { 17 } else { 10 },
offset_2 = if cfg!(nightly) { 19 } else { 10 },
offset_3 = if cfg!(nightly) { 21 } else { 10 },
offset_0 = if cfg!(nightly) { 16 } else { 11 },
offset_1 = if cfg!(nightly) { 18 } else { 11 },
offset_2 = if cfg!(nightly) { 20 } else { 11 },
offset_3 = if cfg!(nightly) { 22 } else { 11 },
)
);
}
Expand Down
3 changes: 3 additions & 0 deletions binrw/tests/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ fn display() {
fn enum_is_eol() {
use binrw::{io::Cursor, BinRead};

#[allow(dead_code)]
#[derive(BinRead, Debug)]
#[br(return_all_errors)]
enum Test {
Expand All @@ -154,6 +155,7 @@ fn enum_is_eol() {
fn is_eof() {
use binrw::{io::Cursor, BinRead};

#[allow(dead_code)]
#[derive(BinRead, Debug)]
enum A {
A([u8; 2]),
Expand Down Expand Up @@ -222,6 +224,7 @@ fn no_seek_data_enum() {
BinRead,
};

#[allow(dead_code)]
#[derive(BinRead, Debug)]
enum Test {
#[br(magic(0u8))]
Expand Down
3 changes: 3 additions & 0 deletions binrw/tests/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ fn read_endian() {
BinRead, Endian,
};

#[allow(dead_code)]
#[derive(BinRead)]
#[br(big)]
struct Big(u16);

#[allow(dead_code)]
#[derive(BinRead)]
#[br(little)]
struct Little(u16);

#[allow(dead_code)]
#[derive(BinRead)]
#[br(is_little = true)]
struct Runtime(u8);
Expand Down
2 changes: 1 addition & 1 deletion binrw_derive/src/named_args/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ident_str! {
}

// Lint: Describing which field name is which prevents confusion.
#[cfg_attr(nightly, allow(clippy::struct_field_names))]
#[allow(clippy::struct_field_names)]
pub(super) struct Builder<'a> {
pub(super) owner_name: Option<&'a Ident>,
pub(super) builder_name: &'a Ident,
Expand Down

0 comments on commit e96a132

Please sign in to comment.