committed by
Arkadiy Paronyan
parent
851b639ecb
commit
7f7e74869c
@@ -54,12 +54,10 @@ pub fn payload<B: ipc::BinaryConvertable>() -> Result<B, BootError> {
|
||||
|
||||
let mut buffer = Vec::new();
|
||||
try!(
|
||||
io::stdin().read_to_end(&mut buffer)
|
||||
.map_err(|io_err| BootError::ReadArgs(io_err))
|
||||
io::stdin().read_to_end(&mut buffer).map_err(BootError::ReadArgs)
|
||||
);
|
||||
|
||||
ipc::binary::deserialize::<B>(&buffer)
|
||||
.map_err(|binary_error| BootError::DecodeArgs(binary_error))
|
||||
ipc::binary::deserialize::<B>(&buffer).map_err(BootError::DecodeArgs)
|
||||
}
|
||||
|
||||
pub fn register(hv_url: &str, control_url: &str, module_id: IpcModuleId) -> GuardedSocket<HypervisorServiceClient<NanoSocket>>{
|
||||
@@ -73,7 +71,7 @@ pub fn register(hv_url: &str, control_url: &str, module_id: IpcModuleId) -> Guar
|
||||
pub fn dependency<C: WithSocket<NanoSocket>>(url: &str)
|
||||
-> Result<GuardedSocket<C>, BootError>
|
||||
{
|
||||
nanoipc::generic_client::<C>(url).map_err(|socket_err| BootError::DependencyConnect(socket_err))
|
||||
nanoipc::generic_client::<C>(url).map_err(BootError::DependencyConnect)
|
||||
}
|
||||
|
||||
pub fn main_thread() -> Arc<AtomicBool> {
|
||||
|
||||
@@ -169,14 +169,10 @@ macro_rules! usage {
|
||||
let result = rustc_serialize::Decodable::decode(&mut toml::Decoder::new(toml::Value::Table(value)));
|
||||
match result {
|
||||
Ok(config) => Ok(config),
|
||||
Err(e) => {
|
||||
return Err(e.into());
|
||||
}
|
||||
Err(e) => Err(e.into()),
|
||||
}
|
||||
},
|
||||
None => {
|
||||
return Err(ArgsError::Parsing(value_parser.errors));
|
||||
},
|
||||
None => Err(ArgsError::Parsing(value_parser.errors)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user