By using a Cursor data struct, I think we can avoid the prepending of the struct length when encoding both Vec<T> and [T; N]. Each element is double length prepended since the length prepending happens in both the encoding implementation for Vec<T> and T when the encoding length is not known at compile time.
I think this can be avoided if we use a type of Cursor<Vec<BFieldElement>> for the decoding process.
By using a
Cursordata struct, I think we can avoid the prepending of the struct length when encoding bothVec<T>and[T; N]. Each element is double length prepended since the length prepending happens in both the encoding implementation forVec<T>andTwhen the encoding length is not known at compile time.I think this can be avoided if we use a type of
Cursor<Vec<BFieldElement>>for the decoding process.