After taking a stab at #1019 , it seems to me that consensus_decode should take d: &mut D and not as it currently does d: D. The reason is - it is basically a wrapper around Read::read which takes &mut self.
Instead of passing &mut d when descending to sub-decoding, the code could just pass d and it would work. Internally it would avoid creating &mut &mut &mut &mut T which seems kind of undesirable, even if compiler probably can get rid of these needless references.
After taking a stab at #1019 , it seems to me that
consensus_decodeshould taked: &mut Dand not as it currently doesd: D. The reason is - it is basically a wrapper aroundRead::readwhich takes&mut self.Instead of passing
&mut dwhen descending to sub-decoding, the code could just passdand it would work. Internally it would avoid creating&mut &mut &mut &mut Twhich seems kind of undesirable, even if compiler probably can get rid of these needless references.