From fc456aeb39fe5e45726b48f6e512310a86291f5c Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Tue, 7 Nov 2023 13:54:33 -0800 Subject: [PATCH] Change bytes accessors to expose only unmodifiable List, making Bytes as a type an internal implementation detail. PiperOrigin-RevId: 580290313 --- conformance/conformance_dart.dart | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/conformance/conformance_dart.dart b/conformance/conformance_dart.dart index 8491fa0827..386e63ec67 100644 --- a/conformance/conformance_dart.dart +++ b/conformance/conformance_dart.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:pb_runtime/ffi/bytes.dart'; import 'package:pb_runtime/pb_runtime.dart' as pb; import 'package:third_party.protobuf/test_messages_proto2.upb.dart'; import 'package:third_party.protobuf/test_messages_proto3.upb.dart'; @@ -50,8 +49,8 @@ ConformanceResponse doTest(ConformanceRequest request) { case ConformanceRequest_payload.protobufPayload: try { testMessage = isProto3 - ? TestAllTypesProto3.fromBinary(request.protobufPayload.data) - : TestAllTypesProto2.fromBinary(request.protobufPayload.data); + ? TestAllTypesProto3.fromBinary(request.protobufPayload) + : TestAllTypesProto2.fromBinary(request.protobufPayload); } catch (e) { final parseErrorResponse = ConformanceResponse(); parseErrorResponse.parseError = '$e'; @@ -66,8 +65,7 @@ ConformanceResponse doTest(ConformanceRequest request) { switch (request.requestedOutputFormat) { case WireFormat.PROTOBUF: try { - response.protobufPayload = - Bytes(pb.GeneratedMessage.toBinary(testMessage)); + response.protobufPayload = pb.GeneratedMessage.toBinary(testMessage); } catch (e) { response.serializeError = '$e'; }