@@ -21,9 +21,9 @@ use axum::response::{ErrorResponse, IntoResponse};
2121use axum:: routing:: MethodRouter ;
2222use axum:: Extension ;
2323use axum_extra:: TypedHeader ;
24- use http_body_util:: BodyExt ;
2524use futures:: TryStreamExt ;
2625use http:: StatusCode ;
26+ use http_body_util:: BodyExt ;
2727use log:: { info, warn} ;
2828use serde:: Deserialize ;
2929use spacetimedb:: database_logger:: DatabaseLogger ;
@@ -41,12 +41,12 @@ use spacetimedb_client_api_messages::name::{
4141} ;
4242use spacetimedb_lib:: db:: raw_def:: v10:: RawModuleDefV10 ;
4343use spacetimedb_lib:: db:: raw_def:: v9:: RawModuleDefV9 ;
44- use spacetimedb_lib:: { bsatn, http as st_http, sats, AlgebraicValue , Hash , ProductValue , Timestamp } ;
4544use spacetimedb_lib:: de as st_de;
45+ use spacetimedb_lib:: sats:: algebraic_value:: de:: ValueDeserializer ;
46+ use spacetimedb_lib:: { bsatn, http as st_http, sats, AlgebraicValue , Hash , ProductValue , Timestamp } ;
4647use spacetimedb_schema:: auto_migrate:: {
4748 MigrationPolicy as SchemaMigrationPolicy , MigrationToken , PrettyPrintStyle as AutoMigratePrettyPrintStyle ,
4849} ;
49- use spacetimedb_lib:: sats:: algebraic_value:: de:: ValueDeserializer ;
5050
5151use super :: subscribe:: { handle_websocket, HasWebSocketOptions } ;
5252
@@ -250,8 +250,12 @@ pub async fn http_route<S: ControlStateDelegate + NodeDelegate>(
250250 . to_bytes ( ) ;
251251
252252 let request_and_body = convert_request_to_st ( parts, body_bytes) ;
253- let args = bsatn:: to_vec ( & request_and_body)
254- . map_err ( |err| ( StatusCode :: INTERNAL_SERVER_ERROR , format ! ( "Failed to encode request: {err}" ) ) ) ?;
253+ let args = bsatn:: to_vec ( & request_and_body) . map_err ( |err| {
254+ (
255+ StatusCode :: INTERNAL_SERVER_ERROR ,
256+ format ! ( "Failed to encode request: {err}" ) ,
257+ )
258+ } ) ?;
255259
256260 let call_result = module
257261 . call_procedure_internal (
@@ -269,8 +273,8 @@ pub async fn http_route<S: ControlStateDelegate + NodeDelegate>(
269273 Err ( _) => return Ok ( StatusCode :: INTERNAL_SERVER_ERROR . into_response ( ) ) ,
270274 } ;
271275
272- let response = decode_response_and_body ( result . return_val )
273- . map_err ( |err| ( StatusCode :: INTERNAL_SERVER_ERROR , err) ) ?;
276+ let response =
277+ decode_response_and_body ( result . return_val ) . map_err ( |err| ( StatusCode :: INTERNAL_SERVER_ERROR , err) ) ?;
274278
275279 let response = response_and_body_to_axum ( response)
276280 . map_err ( |err| ( StatusCode :: INTERNAL_SERVER_ERROR , format ! ( "Invalid response: {err}" ) ) ) ?;
0 commit comments