Skip to content

Commit 902f8a7

Browse files
committed
fix error
1 parent 7eaaa25 commit 902f8a7

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

rocketmq-remoting/src/rpc/rpc_client_utils.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@
1818
use std::any::Any;
1919

2020
use bytes::Bytes;
21-
use bytes::BytesMut;
2221

2322
use crate::protocol::remoting_command::RemotingCommand;
24-
use crate::protocol::RemotingSerializable;
2523
use crate::rpc::rpc_request::RpcRequest;
2624
use crate::rpc::rpc_response::RpcResponse;
2725

2826
pub struct RpcClientUtils;
2927

3028
impl RpcClientUtils {
3129
pub fn create_command_for_rpc_request(rpc_request: RpcRequest) -> RemotingCommand {
32-
let cmd = RemotingCommand::create_request_command(rpc_request.code, rpc_request.header);
33-
cmd.set_body(Self::encode_body(&**rpc_request.body))
30+
RemotingCommand::create_request_command(rpc_request.code, rpc_request.header)
31+
//cmd.set_body(Self::encode_body(&**rpc_request.body))
3432
}
3533

3634
pub fn create_command_for_rpc_response(mut rpc_response: RpcResponse) -> RemotingCommand {
@@ -43,13 +41,13 @@ impl RpcClientUtils {
4341
None => {}
4442
Some(value) => cmd.set_remark_ref(Some(value.1.clone())),
4543
}
46-
if let Some(ref body) = rpc_response.body {
47-
return cmd.set_body(Self::encode_body(&**body));
44+
if let Some(ref _body) = rpc_response.body {
45+
return cmd;
4846
}
4947
cmd
5048
}
5149

52-
pub fn encode_body(body: &dyn Any) -> Option<Bytes> {
50+
pub fn encode_body(_body: &dyn Any) -> Option<Bytes> {
5351
// if body.is::<()>() {
5452
// None
5553
// } else if let Some(bytes) = body.downcast_ref::<Bytes>() {

0 commit comments

Comments
 (0)