arkworks-rs / snark

Interfaces for Relations and SNARKs for these relations
https://www.arkworks.rs
Apache License 2.0
776 stars 209 forks source link

Improve Serialization/Deserialization API to use `mut reader/writer: R/W` #255

Closed Pratyush closed 4 years ago

Pratyush commented 4 years ago

In the process of working on #253, I decided to fix a small nit with the current API of CanonicalSerialize/Deserialize. This is a breaking change, albeit one that's easily fixed via the following substitutions: s/\<reader\>: &mut R/mut reader: R/g and s/\<writer\>: &mut W/mut writer: W/g, along with passing reader/writer by mutable reference to subroutines.

cc @kobigurk @paberr

kobigurk commented 4 years ago

Looks like a good idea to me. I never saw what the best practice is btw. Is it written anywhere?

Pratyush commented 4 years ago

I think here: https://rust-lang.github.io/api-guidelines/interoperability.html#c-rw-value

paberr commented 4 years ago

The mut reader/writer: R/W change looks good to me. :+1: