mirror of
https://github.com/fluencelabs/marine.git
synced 2025-03-15 14:00:50 +00:00
fmt
This commit is contained in:
parent
d9d77b91d9
commit
8a25cc65e4
@ -53,9 +53,9 @@ fn json_map_to_ivalues<'a, 'b>(
|
|||||||
let mut iargs = Vec::new();
|
let mut iargs = Vec::new();
|
||||||
|
|
||||||
for (arg_name, arg_type) in arg_types {
|
for (arg_name, arg_type) in arg_types {
|
||||||
let json_value = json_map.remove(arg_name).ok_or_else(|| {
|
let json_value = json_map
|
||||||
De(format!("missing argument with name {}", arg_name))
|
.remove(arg_name)
|
||||||
})?;
|
.ok_or_else(|| De(format!("missing argument with name {}", arg_name)))?;
|
||||||
let iarg = jvalue_to_ivalue(json_value, arg_type, record_types)?;
|
let iarg = jvalue_to_ivalue(json_value, arg_type, record_types)?;
|
||||||
iargs.push(iarg);
|
iargs.push(iarg);
|
||||||
}
|
}
|
||||||
@ -173,10 +173,7 @@ fn jvalue_to_ivalue(jvalue: JValue, ty: &IType, record_types: &MRecordTypes) ->
|
|||||||
|
|
||||||
Ok(iargs)
|
Ok(iargs)
|
||||||
}
|
}
|
||||||
_ => Err(De(format!(
|
_ => Err(De(format!("expected bytearray, got {:?}", jvalue))),
|
||||||
"expected bytearray, got {:?}",
|
|
||||||
jvalue
|
|
||||||
))),
|
|
||||||
}?;
|
}?;
|
||||||
|
|
||||||
Ok(IValue::Array(value))
|
Ok(IValue::Array(value))
|
||||||
|
@ -104,20 +104,16 @@ impl From<std::convert::Infallible> for FaaSError {
|
|||||||
macro_rules! json_to_faas_err {
|
macro_rules! json_to_faas_err {
|
||||||
($json_expr:expr, $module_name:expr, $function_name:expr) => {
|
($json_expr:expr, $module_name:expr, $function_name:expr) => {
|
||||||
$json_expr.map_err(|e| match e {
|
$json_expr.map_err(|e| match e {
|
||||||
it_json_serde::ITJsonSeDeError::Se(_) => {
|
it_json_serde::ITJsonSeDeError::Se(_) => FaaSError::JsonOutputSerializationError {
|
||||||
FaaSError::JsonOutputSerializationError {
|
|
||||||
module_name: $module_name,
|
module_name: $module_name,
|
||||||
function_name: $function_name,
|
function_name: $function_name,
|
||||||
error: e,
|
error: e,
|
||||||
}
|
},
|
||||||
}
|
it_json_serde::ITJsonSeDeError::De(_) => FaaSError::JsonArgumentsDeserializationError {
|
||||||
it_json_serde::ITJsonSeDeError::De(_) => {
|
|
||||||
FaaSError::JsonArgumentsDeserializationError {
|
|
||||||
module_name: $module_name,
|
module_name: $module_name,
|
||||||
function_name: $function_name,
|
function_name: $function_name,
|
||||||
error: e,
|
error: e,
|
||||||
}
|
},
|
||||||
}
|
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -75,20 +75,16 @@ impl From<std::convert::Infallible> for FaaSError {
|
|||||||
macro_rules! json_to_faas_err {
|
macro_rules! json_to_faas_err {
|
||||||
($json_expr:expr, $module_name:expr, $function_name:expr) => {
|
($json_expr:expr, $module_name:expr, $function_name:expr) => {
|
||||||
$json_expr.map_err(|e| match e {
|
$json_expr.map_err(|e| match e {
|
||||||
it_json_serde::ITJsonSeDeError::Se(_) => {
|
it_json_serde::ITJsonSeDeError::Se(_) => FaaSError::JsonOutputSerializationError {
|
||||||
FaaSError::JsonOutputSerializationError {
|
|
||||||
module_name: $module_name,
|
module_name: $module_name,
|
||||||
function_name: $function_name,
|
function_name: $function_name,
|
||||||
error: e,
|
error: e,
|
||||||
}
|
},
|
||||||
}
|
it_json_serde::ITJsonSeDeError::De(_) => FaaSError::JsonArgumentsDeserializationError {
|
||||||
it_json_serde::ITJsonSeDeError::De(_) => {
|
|
||||||
FaaSError::JsonArgumentsDeserializationError {
|
|
||||||
module_name: $module_name,
|
module_name: $module_name,
|
||||||
function_name: $function_name,
|
function_name: $function_name,
|
||||||
error: e,
|
error: e,
|
||||||
}
|
},
|
||||||
}
|
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user