mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-04 03:05:39 +00:00
refactor: update binary field types and conversions in RPC and protofiles (#2619)
Signed-off-by: 唐小鸭 <tangtang1251@qq.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: houseme <housemecn@gmail.com> Co-authored-by: loverustfs <hello@rustfs.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// Copyright (c) RustFS contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use bytes::Bytes;
|
||||
use rustfs_protos::proto_gen::node_service::{
|
||||
ReadMultipleRequest, ReadMultipleResponse, ReadVersionResponse, ReadXlResponse, UpdateMetadataRequest, WriteMetadataRequest,
|
||||
};
|
||||
|
||||
fn expect_bytes(_: &Bytes) {}
|
||||
|
||||
#[test]
|
||||
fn protobuf_bytes_fields_use_bytes_consistently() {
|
||||
let update = UpdateMetadataRequest::default();
|
||||
expect_bytes(&update.file_info_bin);
|
||||
expect_bytes(&update.opts_bin);
|
||||
|
||||
let write = WriteMetadataRequest::default();
|
||||
expect_bytes(&write.file_info_bin);
|
||||
|
||||
let version = ReadVersionResponse::default();
|
||||
expect_bytes(&version.file_info_bin);
|
||||
|
||||
let read_xl = ReadXlResponse::default();
|
||||
expect_bytes(&read_xl.raw_file_info_bin);
|
||||
|
||||
let read_multiple = ReadMultipleRequest::default();
|
||||
expect_bytes(&read_multiple.read_multiple_req_bin);
|
||||
|
||||
let read_multiple_response = ReadMultipleResponse::default();
|
||||
let first = read_multiple_response
|
||||
.read_multiple_resps_bin
|
||||
.first()
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
expect_bytes(&first);
|
||||
}
|
||||
Reference in New Issue
Block a user