Accept MessageLite type instead of the Message type in SerializeMsg

We don't need any of the functionality provided by Message. This is a step towards building Rust protos with C++ lite.

PiperOrigin-RevId: 638216968
pull/16969/head
Jakob Buchgraber 10 months ago committed by Copybara-Service
parent 05e5107d98
commit 01ec3fab1f
  1. 2
      rust/cpp_kernel/cpp_api.h

@ -41,7 +41,7 @@ extern "C" struct SerializedData {
// This function is defined in `rust_alloc_for_cpp_api.rs`.
extern "C" void* __pb_rust_alloc(size_t size, size_t align);
inline SerializedData SerializeMsg(const google::protobuf::Message* msg) {
inline SerializedData SerializeMsg(const google::protobuf::MessageLite* msg) {
size_t len = msg->ByteSizeLong();
void* bytes = __pb_rust_alloc(len, alignof(char));
if (bytes == nullptr) {

Loading…
Cancel
Save