From cb3b8bb9118ff473fcd2377536d0d37b36573eab Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 7 Apr 2020 14:29:57 +0200 Subject: [PATCH] fix(interface-types) Don't duplicate code in the binary encoder. Use the `ToBytes` implementation of `RecordType` to encode the inner record type of a type, so that it avoids code duplication. --- src/encoders/binary.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/encoders/binary.rs b/src/encoders/binary.rs index 2849dce..2582846 100644 --- a/src/encoders/binary.rs +++ b/src/encoders/binary.rs @@ -170,9 +170,9 @@ where outputs.to_bytes(writer)?; } - Type::Record(RecordType { fields }) => { + Type::Record(record_type) => { TypeKind::Record.to_bytes(writer)?; - fields.to_bytes(writer)?; + record_type.to_bytes(writer)?; } }