Skip to content

Commit 6df97e6

Browse files
committed
Remove method name from RpcRequest
1 parent 4399e7d commit 6df97e6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

core/src/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,14 @@ where
144144

145145
struct InnerRpcRequest<T, F> {
146146
transport_future: F,
147-
method: String,
148147
id: Id,
149148
_marker: ::std::marker::PhantomData<T>,
150149
}
151150

152151
impl<T, F> InnerRpcRequest<T, F> {
153-
fn new(transport_future: F, method: String, id: Id) -> Self {
152+
fn new(transport_future: F, id: Id) -> Self {
154153
Self {
155154
transport_future,
156-
method,
157155
id,
158156
_marker: ::std::marker::PhantomData,
159157
}
@@ -176,9 +174,8 @@ where
176174
.chain_err(|| ErrorKind::TransportError)
177175
);
178176
trace!(
179-
"Deserializing {} byte response to method \"{}\" with id {:?}",
177+
"Deserializing {} byte response to request with id {:?}",
180178
response_raw.len(),
181-
self.method,
182179
self.id
183180
);
184181
response::parse(&response_raw, &self.id).map(|t| Async::Ready(t))
@@ -224,13 +221,13 @@ where
224221
{
225222
let id = Id::Num(transport.get_next_id());
226223
trace!("Serializing call to method \"{}\" with id {:?}", method, id);
227-
let request_serialization_result = serialize_request(id.clone(), method.clone(), params)
224+
let request_serialization_result = serialize_request(id.clone(), method, params)
228225
.chain_err(|| ErrorKind::SerializeError);
229226
match request_serialization_result {
230227
Err(e) => RpcRequest(Err(Some(e))),
231228
Ok(request_raw) => {
232229
let transport_future = transport.send(request_raw);
233-
RpcRequest(Ok(InnerRpcRequest::new(transport_future, method, id)))
230+
RpcRequest(Ok(InnerRpcRequest::new(transport_future, id)))
234231
}
235232
}
236233
}

0 commit comments

Comments
 (0)