This code:
should be simplified. It's confusing to compute value and then most of the time not use it but instead hardcode "value".
It would be nice to add some comments too. For example, explain why we create this strange helper variable:
let is_optional = type_ref.is_optional && !is_tagged;
This code:
icerpc-csharp/tools/slicec-cs/src/encoding.rs
Line 349 in b06a0d0
should be simplified. It's confusing to compute value and then most of the time not use it but instead hardcode "value".
It would be nice to add some comments too. For example, explain why we create this strange helper variable: