File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use core::any::{Any, TypeId};
7
7
8
8
// yolo
9
9
10
- /// Get a `type_id` from it's previously unpacked `u64`.
10
+ /// Get a `type_id` from its previously unpacked `u64`.
11
11
/// Opposite of [`unpack_type_id(id)`].
12
12
///
13
13
/// # Safety
Original file line number Diff line number Diff line change @@ -113,10 +113,13 @@ where
113
113
where
114
114
S : HasMetadata ,
115
115
{
116
- if state. metadata ( ) . get :: < CmpValuesMetadata > ( ) . is_none ( ) {
116
+ #[ allow( clippy:: clippy:: option_if_let_else) ] // we can't mutate state in a closure
117
+ let meta = if let Some ( meta) = state. metadata_mut ( ) . get_mut :: < CmpValuesMetadata > ( ) {
118
+ meta
119
+ } else {
117
120
state. add_metadata ( CmpValuesMetadata :: new ( ) ) ;
118
- }
119
- let meta = state . metadata_mut ( ) . get_mut :: < CmpValuesMetadata > ( ) . unwrap ( ) ;
121
+ state . metadata_mut ( ) . get_mut :: < CmpValuesMetadata > ( ) . unwrap ( )
122
+ } ;
120
123
meta. list . clear ( ) ;
121
124
let count = self . usable_count ( ) ;
122
125
for i in 0 ..count {
You can’t perform that action at this time.
0 commit comments