@@ -34,10 +34,10 @@ pub fn from_last_chunk<const CAP: usize, Item, Gap>(
34
34
// Check consistency before creating the `LinkedChunk`.
35
35
{
36
36
// The number of items is not too large.
37
- if let ChunkContent :: Items ( items) = & chunk. content {
38
- if items. len ( ) > CAP {
39
- return Err ( LazyLoaderError :: ChunkTooLarge { id : chunk . identifier } ) ;
40
- }
37
+ if let ChunkContent :: Items ( items) = & chunk. content
38
+ && items. len ( ) > CAP
39
+ {
40
+ return Err ( LazyLoaderError :: ChunkTooLarge { id : chunk . identifier } ) ;
41
41
}
42
42
43
43
// Chunk has no next chunk.
@@ -80,20 +80,20 @@ where
80
80
// Check `LinkedChunk` is going to be consistent after the insertion.
81
81
{
82
82
// The number of items is not too large.
83
- if let ChunkContent :: Items ( items) = & new_first_chunk. content {
84
- if items. len ( ) > CAP {
85
- return Err ( LazyLoaderError :: ChunkTooLarge { id : new_first_chunk . identifier } ) ;
86
- }
83
+ if let ChunkContent :: Items ( items) = & new_first_chunk. content
84
+ && items. len ( ) > CAP
85
+ {
86
+ return Err ( LazyLoaderError :: ChunkTooLarge { id : new_first_chunk . identifier } ) ;
87
87
}
88
88
89
89
// New chunk doesn't create a cycle.
90
- if let Some ( previous_chunk) = new_first_chunk. previous {
91
- if linked_chunk. chunks ( ) . any ( |chunk| chunk. identifier ( ) == previous_chunk) {
92
- return Err ( LazyLoaderError :: Cycle {
93
- new_chunk : new_first_chunk . identifier ,
94
- with_chunk : previous_chunk ,
95
- } ) ;
96
- }
90
+ if let Some ( previous_chunk) = new_first_chunk. previous
91
+ && linked_chunk. chunks ( ) . any ( |chunk| chunk. identifier ( ) == previous_chunk)
92
+ {
93
+ return Err ( LazyLoaderError :: Cycle {
94
+ new_chunk : new_first_chunk . identifier ,
95
+ with_chunk : previous_chunk ,
96
+ } ) ;
97
97
}
98
98
99
99
let first_chunk = linked_chunk. links . first_chunk ( ) ;
@@ -233,10 +233,10 @@ where
233
233
234
234
// Check consistency before replacing the `LinkedChunk`.
235
235
// The number of items is not too large.
236
- if let ChunkContent :: Items ( items) = & chunk. content {
237
- if items. len ( ) > CAP {
238
- return Err ( LazyLoaderError :: ChunkTooLarge { id : chunk . identifier } ) ;
239
- }
236
+ if let ChunkContent :: Items ( items) = & chunk. content
237
+ && items. len ( ) > CAP
238
+ {
239
+ return Err ( LazyLoaderError :: ChunkTooLarge { id : chunk . identifier } ) ;
240
240
}
241
241
242
242
// Chunk has no next chunk.
0 commit comments