icerpc / icerpc-csharp

A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
https://docs.icerpc.dev
Apache License 2.0
101 stars 13 forks source link

Update enum with field Decode implementation #3868

Closed bernardnormier closed 9 months ago

bernardnormier commented 9 months ago

This PR updates the implementation of the DecodeXxx extension method, when Xxx is an enum with fields.

The implementation is now using local functions instead of FromSliceDecoder helper methods on the enumerator classes.

I initially wanted to do the same for EncodeXxx, but finally kept the existing logic. I just updated to code to make the helper internal Encode methods "never editor browsable".