diff --git a/util/proto/marshal.go b/util/proto/marshal.go index 7bc8162..e345492 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -255,7 +255,7 @@ func NestedStructurePrefix(field int64) (prefix uint64, ln int) { return prefix, VarUIntSize(prefix) } -func NestedStructureMarshal(field int64, buf []byte, v stableMarshaller) int { +func NestedStructureMarshal[T stableMarshaller](field int64, buf []byte, v T) int { n := v.StableSize() if n == 0 { return 0 @@ -269,7 +269,7 @@ func NestedStructureMarshal(field int64, buf []byte, v stableMarshaller) int { return offset + n } -func NestedStructureSize(field int64, v stableMarshaller) (size int) { +func NestedStructureSize[T stableMarshaller](field int64, v T) (size int) { n := v.StableSize() if n == 0 { return 0