This issue is somewhat of an extension of my last issue #666 that asked regarding adapting the configuration in regards to endianness.
Right now I create two configurations (p.e. le_config and be_config) depending on the endianness and when parsing I include an if-statement to add the proper configuration. Similar to this:
let (item, _): (HeaderItem, usize) = bincode::decode_from_slice(
data,
if is_little_endian {
le_config
} else {
be_config
},
)
.unwrap()
I would like to get rid of the clause by storing the configuration in a variable. I looked into it and could not find a solution for this. Is my assumption correct that this is a similar case to #399 ?
This issue is somewhat of an extension of my last issue #666 that asked regarding adapting the configuration in regards to endianness.
Right now I create two configurations (p.e.
le_config
andbe_config
) depending on the endianness and when parsing I include anif
-statement to add the proper configuration. Similar to this:I would like to get rid of the clause by storing the configuration in a variable. I looked into it and could not find a solution for this. Is my assumption correct that this is a similar case to #399 ?