File tree Expand file tree Collapse file tree 2 files changed +235
-124
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +235
-124
lines changed
Original file line number Diff line number Diff line change @@ -123,6 +123,13 @@ impl<'a> Item<'a> {
123
123
. map_err ( |_| UnexpectedData )
124
124
. map ( u8:: from_le_bytes)
125
125
} ;
126
+ let d8u = || {
127
+ Ok ( match d {
128
+ & [ ] => 0 ,
129
+ & [ a] => a,
130
+ _ => return Err ( UnexpectedData ) ,
131
+ } )
132
+ } ;
126
133
let d16u = || {
127
134
Ok ( u16:: from_le_bytes ( match d {
128
135
& [ ] => [ 0 , 0 ] ,
@@ -156,7 +163,7 @@ impl<'a> Item<'a> {
156
163
let item = match tag {
157
164
Self :: INPUT => Self :: Input ( MainFlags ( d32u ( ) ?) ) ,
158
165
Self :: OUTPUT => Self :: Output ( MainFlags ( d32u ( ) ?) ) ,
159
- Self :: COLLECTION => Self :: Collection ( Collection :: from_raw ( d8 ( ) ?) ) ,
166
+ Self :: COLLECTION => Self :: Collection ( Collection :: from_raw ( d8u ( ) ?) ) ,
160
167
Self :: FEATURE => Self :: Feature ( MainFlags ( d32u ( ) ?) ) ,
161
168
Self :: END_COLLECTION => d_empty ( Self :: EndCollection ) ?,
162
169
You can’t perform that action at this time.
0 commit comments