Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Optimize offchain worker api by re-using http-client #6454

Merged
merged 8 commits into from
Jun 23, 2020
Prev Previous commit
Next Next commit
Use Self keyword in AsyncApi::new()
  • Loading branch information
Scott Piriou committed Jun 21, 2020
commit c23b583bf2e50366efb61618fea0b24ca5ba17ba
4 changes: 2 additions & 2 deletions client/offchain/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl AsyncApi {
db: S,
network_state: Arc<dyn NetworkStateInfo + Send + Sync>,
is_validator: bool,
) -> (Api<S>, AsyncApi) {
) -> (Api<S>, Self) {
let (http_api, http_worker) = http::http();

let api = Api {
Expand All @@ -270,7 +270,7 @@ impl AsyncApi {
http: http_api,
};

let async_api = AsyncApi {
let async_api = Self {
http: Some(http_worker),
};

Expand Down