Skip to content

Commit 1e7f57a

Browse files
committed
Ignore clippy::large_enum_variant lint on State
``` error: large size difference between variants --> src/lib.rs:321:1 | 321 | / enum State { 322 | | Idle(Option<std::fs::ReadDir>), | | ------------------------------ the largest variant contains at least 624 bytes 323 | | Busy(blocking::Task<(std::fs::ReadDir, Option<io::Result<std::fs::DirEntry>>)>), | | ------------------------------------------------------------------------------- the second-largest variant contains at least 8 bytes 324 | | } | |_^ the entire enum is at least 624 bytes | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant = note: `-D clippy::large-enum-variant` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::large_enum_variant)]` help: consider boxing the large fields to reduce the total size of the enum | 322 - Idle(Option<std::fs::ReadDir>), 322 + Idle(Box<Option<std::fs::ReadDir>>), | ```
1 parent dfbfe17 commit 1e7f57a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ pub struct ReadDir(State);
318318
/// The state of an asynchronous `ReadDir`.
319319
///
320320
/// The `ReadDir` can be either idle or busy performing an asynchronous operation.
321+
#[allow(clippy::large_enum_variant)] // TODO: Windows-specific
321322
enum State {
322323
Idle(Option<std::fs::ReadDir>),
323324
Busy(blocking::Task<(std::fs::ReadDir, Option<io::Result<std::fs::DirEntry>>)>),

0 commit comments

Comments
 (0)