| 452 | } |
| 453 | |
| 454 | Status ToPayload(const FlightDescriptor& descr, std::shared_ptr<Buffer>* out) { |
| 455 | // TODO(ARROW-15612): make these use Result<T> |
| 456 | std::string str_descr; |
| 457 | pb::FlightDescriptor pb_descr; |
| 458 | RETURN_NOT_OK(ToProto(descr, &pb_descr)); |
| 459 | if (!pb_descr.SerializeToString(&str_descr)) { |
| 460 | return Status::UnknownError("Failed to serialize Flight descriptor"); |
| 461 | } |
| 462 | *out = Buffer::FromString(std::move(str_descr)); |
| 463 | return Status::OK(); |
| 464 | } |
| 465 | |
| 466 | namespace { |
| 467 |
no test coverage detected