Removing Option from setup_rpc_server method return type

This commit is contained in:
Tomasz Drwięga 2016-04-07 12:55:06 +02:00
parent d1e3c633e5
commit 2adeb9fe88

View File

@ -274,7 +274,7 @@ fn setup_rpc_server(
url: &str, url: &str,
cors_domain: &str, cors_domain: &str,
apis: Vec<&str> apis: Vec<&str>
) -> Option<Box<Any>> { ) -> Box<Any> {
use rpc::v1::*; use rpc::v1::*;
let server = rpc::RpcServer::new(); let server = rpc::RpcServer::new();
@ -296,7 +296,7 @@ fn setup_rpc_server(
match start_result { match start_result {
Err(rpc::RpcServerError::IoError(err)) => die_with_io_error(err), Err(rpc::RpcServerError::IoError(err)) => die_with_io_error(err),
Err(e) => die!("{:?}", e), Err(e) => die!("{:?}", e),
Ok(handle) => Some(Box::new(handle)), Ok(handle) => Box::new(handle),
} }
} }
@ -604,7 +604,7 @@ impl Configuration {
SocketAddr::from_str(&url).unwrap_or_else(|_| die!("{}: Invalid JSONRPC listen host/port given.", url)); SocketAddr::from_str(&url).unwrap_or_else(|_| die!("{}: Invalid JSONRPC listen host/port given.", url));
let cors_domain = self.args.flag_rpccorsdomain.as_ref().unwrap_or(&self.args.flag_jsonrpc_cors); let cors_domain = self.args.flag_rpccorsdomain.as_ref().unwrap_or(&self.args.flag_jsonrpc_cors);
setup_rpc_server( Some(setup_rpc_server(
service.client(), service.client(),
sync.clone(), sync.clone(),
account_service.clone(), account_service.clone(),
@ -612,7 +612,7 @@ impl Configuration {
&url, &url,
&cors_domain, &cors_domain,
apis.split(',').collect() apis.split(',').collect()
) ))
} else { } else {
None None
}; };