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

Commit

Permalink
Fix compilation on recent nightlies (#10991)
Browse files Browse the repository at this point in the history
For reasons unknown (to me) recent rustc nightlies can't find the `format!`-macro in `core` when there is an import named `core`. This PR removes the package rename and uses the full `jsonrpc_core` crate name instead.
  • Loading branch information
dvdplm committed Sep 11, 2019
1 parent 453b6a0 commit 4eeac61
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions ipfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern crate rlp;
extern crate ethcore;
extern crate parity_bytes as bytes;
extern crate ethereum_types;
extern crate jsonrpc_core as core;
extern crate jsonrpc_core;
extern crate jsonrpc_http_server as http;

pub mod error;
Expand All @@ -32,8 +32,8 @@ use std::thread;
use std::sync::{mpsc, Arc};
use std::net::{SocketAddr, IpAddr};

use core::futures::future::{self, FutureResult};
use core::futures::{self, Future};
use jsonrpc_core::futures::future::{self, FutureResult};
use jsonrpc_core::futures::{self, Future};
use ethcore::client::BlockChainClient;
use http::hyper::{self, server, Method, StatusCode, Body,
header::{self, HeaderValue},
Expand All @@ -51,19 +51,19 @@ pub struct IpfsHandler {
/// Hostnames allowed in the `Host` request header
allowed_hosts: Option<Vec<Host>>,
/// Reference to the Blockchain Client
client: Arc<BlockChainClient>,
client: Arc<dyn BlockChainClient>,
}

impl IpfsHandler {
pub fn client(&self) -> &BlockChainClient {
pub fn client(&self) -> &dyn BlockChainClient {
&*self.client
}

pub fn new(cors: DomainsValidation<AccessControlAllowOrigin>, hosts: DomainsValidation<Host>, client: Arc<BlockChainClient>) -> Self {
pub fn new(cors: DomainsValidation<AccessControlAllowOrigin>, hosts: DomainsValidation<Host>, client: Arc<dyn BlockChainClient>) -> Self {
IpfsHandler {
cors_domains: cors.into(),
allowed_hosts: hosts.into(),
client: client,
client,
}
}
pub fn on_request(&self, req: hyper::Request<Body>) -> (Option<HeaderValue>, Out) {
Expand Down Expand Up @@ -154,7 +154,7 @@ pub fn start_server(
interface: String,
cors: DomainsValidation<AccessControlAllowOrigin>,
hosts: DomainsValidation<Host>,
client: Arc<BlockChainClient>
client: Arc<dyn BlockChainClient>
) -> Result<Listening, ServerError> {

let ip: IpAddr = interface.parse().map_err(|_| ServerError::InvalidInterface)?;
Expand Down Expand Up @@ -182,12 +182,12 @@ pub fn start_server(
};

let server = server_bldr
.serve(new_service)
.map_err(|_| ())
.select(shutdown_signal.map_err(|_| ()))
.then(|_| Ok(()));
.serve(new_service)
.map_err(|_| ())
.select(shutdown_signal.map_err(|_| ()))
.then(|_| Ok(()));

hyper::rt::run(server);
hyper::rt::run(server);
send(Ok(()));
});

Expand Down

0 comments on commit 4eeac61

Please sign in to comment.