Skip to content

Commit 028d2b4

Browse files
committed
ref: cargo fmt
1 parent 0c0a2c2 commit 028d2b4

3 files changed

Lines changed: 19 additions & 17 deletions

File tree

adapter/rest/src/content_type.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ pub fn parse_body(
7575
BodyFormat::Unknown => {
7676
// If there is no content type
7777
if content_type.is_none()
78-
&& let Ok(value) = parse_text_body(body) {
79-
return Ok(value);
80-
}
78+
&& let Ok(value) = parse_text_body(body)
79+
{
80+
return Ok(value);
81+
}
8182

8283
Err(BodyParseError::UnsupportedContentType {
8384
observed: content_type.unwrap_or("<missing>").to_string(),

adapter/rest/src/main.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ async fn execute_flow_to_hyper_response(
9090
})),
9191
} = &result
9292
&& result_fields.contains_key("name")
93-
&& result_fields.contains_key("message")
94-
&& !result_fields.contains_key("payload")
95-
&& !result_fields.contains_key("headers")
96-
{
97-
log::debug!("Detected a RuntimeError");
98-
let name = get_string("name", &result);
99-
let message = get_string("message", &result);
100-
101-
return error_to_http_response(
102-
StatusCode::INTERNAL_SERVER_ERROR,
103-
format!("{}: {}", name.unwrap(), message.unwrap()).as_str(),
104-
);
105-
}
93+
&& result_fields.contains_key("message")
94+
&& !result_fields.contains_key("payload")
95+
&& !result_fields.contains_key("headers")
96+
{
97+
log::debug!("Detected a RuntimeError");
98+
let name = get_string("name", &result);
99+
let message = get_string("message", &result);
100+
101+
return error_to_http_response(
102+
StatusCode::INTERNAL_SERVER_ERROR,
103+
format!("{}: {}", name.unwrap(), message.unwrap()).as_str(),
104+
);
105+
}
106106

107107
value_to_http_response(result)
108108
}

crates/base/src/store.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ impl AdapterStore {
121121
// TODO: Replace body vaidation with triangulus when its ready
122122
let uuid = uuid::Uuid::new_v4().to_string();
123123
let flow_id = flow.flow_id;
124-
let execution_flow: ExecutionFlow = Self::convert_validation_flow(flow, input_value.clone());
124+
let execution_flow: ExecutionFlow =
125+
Self::convert_validation_flow(flow, input_value.clone());
125126
let bytes = execution_flow.encode_to_vec();
126127
let topic = format!("execution.{}", uuid);
127128
log::info!(

0 commit comments

Comments
 (0)