Skip to content

consensus_decode should take &mut D? #1020

@dpc

Description

@dpc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions