@@ -43,11 +43,19 @@ pub fn local_router(service: Arc<GameService>, address: SocketAddr) -> Result<Ro
4343///
4444/// The host must install this same LiveUpdates instance with GameService::with_observer.
4545/// Periodic reconciliation also catches commits from other hosts sharing the store.
46- pub fn local_router_with_updates ( service : Arc < GameService > , address : SocketAddr , updates : Arc < LiveUpdates > ) -> Result < Router , ApiError > {
46+ pub fn local_router_with_updates (
47+ service : Arc < GameService > ,
48+ address : SocketAddr ,
49+ updates : Arc < LiveUpdates > ,
50+ ) -> Result < Router , ApiError > {
4751 build_router ( service, address, Some ( updates) )
4852}
4953
50- fn build_router ( service : Arc < GameService > , address : SocketAddr , updates : Option < Arc < LiveUpdates > > ) -> Result < Router , ApiError > {
54+ fn build_router (
55+ service : Arc < GameService > ,
56+ address : SocketAddr ,
57+ updates : Option < Arc < LiveUpdates > > ,
58+ ) -> Result < Router , ApiError > {
5159 if !address. ip ( ) . is_loopback ( ) || address. port ( ) == 0 {
5260 return Err ( ApiError :: new (
5361 "INVALID_CONFIG" ,
@@ -67,9 +75,13 @@ fn build_router(service: Arc<GameService>, address: SocketAddr, updates: Option<
6775 . fallback ( not_found)
6876 . method_not_allowed_fallback ( method_not_allowed) ;
6977 if let Some ( updates) = updates {
70- router = router. route ( "/v1/matches/{id}/stream" , get ( stream:: upgrade) . layer ( axum:: Extension ( updates) ) ) ;
78+ router = router. route (
79+ "/v1/matches/{id}/stream" ,
80+ get ( stream:: upgrade) . layer ( axum:: Extension ( updates) ) ,
81+ ) ;
7182 }
72- Ok ( router. layer ( DefaultBodyLimit :: max ( MAX_BODY_BYTES ) )
83+ Ok ( router
84+ . layer ( DefaultBodyLimit :: max ( MAX_BODY_BYTES ) )
7385 . layer ( middleware:: from_fn_with_state (
7486 access:: LocalAccess :: new ( address) ,
7587 access:: guard,
0 commit comments