File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use base:: traits:: LoadConfig ;
22use code0_flow:: flow_config:: env_with_default;
33
4-
54#[ derive( Clone ) ]
65pub struct HttpServerConfig {
76 pub port : u16 ,
Original file line number Diff line number Diff line change @@ -92,10 +92,7 @@ async fn execute_flow_to_hyper_response(
9292 body : Vec < u8 > ,
9393 store : Arc < base:: store:: AdapterStore > ,
9494) -> Response < Full < Bytes > > {
95- let value: Option < Value > = match prost:: Message :: decode ( body. as_slice ( ) ) {
96- Ok ( v) => Some ( v) ,
97- Err ( _) => None ,
98- } ;
95+ let value: Option < Value > = prost:: Message :: decode ( body. as_slice ( ) ) . ok ( ) ;
9996
10097 match store. validate_and_execute_flow ( flow, value) . await {
10198 Some ( result) => {
@@ -150,9 +147,9 @@ async fn execute_flow_to_hyper_response(
150147 kind : Some ( StructValue ( Struct { fields : f } ) ) ,
151148 } = x
152149 {
153- return Some ( f) ;
150+ Some ( f)
154151 } else {
155- return None ;
152+ None
156153 }
157154 } )
158155 . filter_map ( |f| {
@@ -183,8 +180,7 @@ async fn execute_flow_to_hyper_response(
183180 None => return None ,
184181 } ;
185182
186-
187- return Some ( ( key. clone ( ) , value. clone ( ) ) ) ;
183+ Some ( ( key. clone ( ) , value. clone ( ) ) )
188184 } )
189185 . collect ( ) ;
190186
@@ -207,7 +203,7 @@ async fn execute_flow_to_hyper_response(
207203 }
208204 None => {
209205 log:: error!( "flow execution failed" ) ;
210- return json_error ( StatusCode :: INTERNAL_SERVER_ERROR , "Flow execution failed" ) ;
206+ json_error ( StatusCode :: INTERNAL_SERVER_ERROR , "Flow execution failed" )
211207 }
212208 }
213209}
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ impl IdentifiableFlow for RequestRoute {
6969 match regex:: Regex :: new ( regex_str) {
7070 Ok ( regex) => {
7171 log:: debug!( "found a match for {}" , regex_str) ;
72- return regex. is_match ( & self . url ) ;
72+ regex. is_match ( & self . url )
7373 }
7474 Err ( err) => {
7575 log:: error!( "Failed to compile regex: {}" , err) ;
You can’t perform that action at this time.
0 commit comments