Remove RawResponse::empty()

This commit is contained in:
Ville Penttinen 2019-02-27 12:57:59 +02:00
parent 33cebe1724
commit 6eb45c1c2b
2 changed files with 5 additions and 7 deletions

View file

@ -120,11 +120,6 @@ impl RawResponse {
let error = RawResponseError { code, message, data: None };
RawResponse { id, result: None, error: Some(error) }
}
/// Returns an "empty" RawResponse
/// Empty response still has a value `()` in its `result` field.
pub fn empty(id: u64) -> RawResponse {
RawResponse { id, result: Some(to_value(&()).unwrap()), error: None }
}
}
impl RawNotification {

View file

@ -425,8 +425,11 @@ impl<'a> PoolDispatcher<'a> {
// ErrorCode::ContentModified as i32,
// "content modified".to_string(),
// )
RawResponse::empty(id)
RawResponse {
id,
result: Some(serde_json::to_value(&()).unwrap()),
error: None,
}
} else {
RawResponse::err(
id,