Revert "[#69] util: Rename stableMarshaler"

This reverts commit 241a9f1ad0.
This commit is contained in:
Evgenii Stratonikov 2024-07-17 14:08:06 +03:00
parent 241a9f1ad0
commit 499bb1ff2b

View file

@ -15,7 +15,7 @@ import (
)
type (
stableMarshaler interface {
stableMarshaller interface {
StableMarshal([]byte) []byte
StableSize() int
}
@ -250,7 +250,7 @@ func VarUIntSize(x uint64) int {
}
type ptrStableMarshaler[T any] interface {
stableMarshaler
stableMarshaller
~*T
}
@ -262,7 +262,7 @@ func NestedStructureMarshal[T any, M ptrStableMarshaler[T]](field int64, buf []b
return NestedStructureMarshalUnchecked(field, buf, v)
}
func NestedStructureMarshalUnchecked[T stableMarshaler](field int64, buf []byte, v T) int {
func NestedStructureMarshalUnchecked[T stableMarshaller](field int64, buf []byte, v T) int {
n := v.StableSize()
prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType)
offset := binary.PutUvarint(buf, prefix)
@ -280,7 +280,7 @@ func NestedStructureSize[T any, M ptrStableMarshaler[T]](field int64, v M) (size
return NestedStructureSizeUnchecked(field, v)
}
func NestedStructureSizeUnchecked[T stableMarshaler](field int64, v T) int {
func NestedStructureSizeUnchecked[T stableMarshaller](field int64, v T) int {
n := v.StableSize()
return protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(n))
}