@@ -93,7 +93,7 @@ macro_rules! check_tlv_order {
93
93
#[ allow( unused_comparisons) ] // Note that $type may be 0 making the second comparison always true
94
94
let invalid_order = ( $last_seen_type. is_none( ) || $last_seen_type. unwrap( ) < $type) && $typ. 0 > $type;
95
95
if invalid_order {
96
- Err ( DecodeError :: InvalidValue ) ?
96
+ return Err ( DecodeError :: InvalidValue ) ;
97
97
}
98
98
} } ;
99
99
( $last_seen_type: expr, $typ: expr, $type: expr, option) => { {
@@ -109,7 +109,7 @@ macro_rules! check_missing_tlv {
109
109
#[ allow( unused_comparisons) ] // Note that $type may be 0 making the second comparison always true
110
110
let missing_req_type = $last_seen_type. is_none( ) || $last_seen_type. unwrap( ) < $type;
111
111
if missing_req_type {
112
- Err ( DecodeError :: InvalidValue ) ?
112
+ return Err ( DecodeError :: InvalidValue ) ;
113
113
}
114
114
} } ;
115
115
( $last_seen_type: expr, $type: expr, vec_type) => { {
@@ -149,20 +149,20 @@ macro_rules! decode_tlv_stream {
149
149
match ser:: Readable :: read( & mut tracking_reader) {
150
150
Err ( DecodeError :: ShortRead ) => {
151
151
if !tracking_reader. have_read {
152
- break ' tlv_read
152
+ break ' tlv_read;
153
153
} else {
154
- Err ( DecodeError :: ShortRead ) ?
154
+ return Err ( DecodeError :: ShortRead ) ;
155
155
}
156
156
} ,
157
- Err ( e) => Err ( e) ? ,
157
+ Err ( e) => return Err ( e) ,
158
158
Ok ( t) => t,
159
159
}
160
160
} ;
161
161
162
162
// Types must be unique and monotonically increasing:
163
163
match last_seen_type {
164
164
Some ( t) if typ. 0 <= t => {
165
- Err ( DecodeError :: InvalidValue ) ?
165
+ return Err ( DecodeError :: InvalidValue ) ;
166
166
} ,
167
167
_ => { } ,
168
168
}
@@ -180,11 +180,11 @@ macro_rules! decode_tlv_stream {
180
180
decode_tlv!( s, $field, $fieldty) ;
181
181
if s. bytes_remain( ) {
182
182
s. eat_remaining( ) ?; // Return ShortRead if there's actually not enough bytes
183
- Err ( DecodeError :: InvalidValue ) ?
183
+ return Err ( DecodeError :: InvalidValue ) ;
184
184
}
185
185
} , ) *
186
186
x if x % 2 == 0 => {
187
- Err ( DecodeError :: UnknownRequiredFeature ) ?
187
+ return Err ( DecodeError :: UnknownRequiredFeature ) ;
188
188
} ,
189
189
_ => { } ,
190
190
}
@@ -490,7 +490,7 @@ macro_rules! impl_writeable_tlv_based_enum {
490
490
Ok ( $st:: $tuple_variant_name( Readable :: read( reader) ?) )
491
491
} ) ,*
492
492
_ => {
493
- Err ( DecodeError :: UnknownRequiredFeature ) ?
493
+ Err ( DecodeError :: UnknownRequiredFeature )
494
494
} ,
495
495
}
496
496
}
0 commit comments