#[allow(unused_comparisons)] // Note that $type may be 0 making the second comparison always true
let invalid_order = ($last_seen_type.is_none() || $last_seen_type.unwrap() < $type) && $typ.0 > $type;
if invalid_order {
- $field = $default;
+ $field = $default.into();
}
}};
($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, required) => {{
#[allow(unused_comparisons)] // Note that $type may be 0 making the second comparison always true
let missing_req_type = $last_seen_type.is_none() || $last_seen_type.unwrap() < $type;
if missing_req_type {
- $field = $default;
+ $field = $default.into();
}
}};
($last_seen_type: expr, $type: expr, $field: ident, required) => {{
macro_rules! init_tlv_based_struct_field {
($field: ident, (default_value, $default: expr)) => {
- $field
+ $field.0.unwrap()
};
($field: ident, option) => {
$field
macro_rules! init_tlv_field_var {
($field: ident, (default_value, $default: expr)) => {
- let mut $field = $default;
+ let mut $field = ::util::ser::OptionDeserWrapper(None);
};
($field: ident, required) => {
let mut $field = ::util::ser::OptionDeserWrapper(None);