@@ -60,7 +60,10 @@ pub fn poll_websocket_stream(
6060 mut events : EventWriter < UpdateStructure > ,
6161) {
6262 while let Ok ( update) = stream. receiver . try_recv ( ) {
63- info ! ( "Received structure update with {} atoms" , update. atoms. len( ) ) ;
63+ info ! (
64+ "Received structure update with {} atoms" ,
65+ update. atoms. len( )
66+ ) ;
6467 events. write ( update) ;
6568 }
6669}
@@ -90,7 +93,10 @@ fn setup_native_websocket(tx: Sender<UpdateStructure>) {
9093 serde_json:: from_str :: < StructureMessage > ( & text)
9194 {
9295 let atoms = structure_msg
93- . atoms . into_iter ( ) . map ( std:: convert:: Into :: into) . collect ( ) ;
96+ . atoms
97+ . into_iter ( )
98+ . map ( std:: convert:: Into :: into)
99+ . collect ( ) ;
94100
95101 if tx. send ( UpdateStructure { atoms } ) . is_err ( ) {
96102 println ! ( "Bevy channel closed" ) ;
@@ -112,7 +118,8 @@ fn setup_native_websocket(tx: Sender<UpdateStructure>) {
112118 }
113119 Err ( e) => eprintln ! ( "Failed to connect WS: {}" , e) ,
114120 }
115- } ) . detach ( ) ;
121+ } )
122+ . detach ( ) ;
116123}
117124
118125// WASM WebSocket client using web-sys
@@ -130,11 +137,7 @@ fn setup_wasm_websocket(tx: Sender<UpdateStructure>) {
130137 if let Ok ( txt) = e. data ( ) . dyn_into :: < js_sys:: JsString > ( ) {
131138 let text: String = txt. into ( ) ;
132139 if let Ok ( structure_msg) = serde_json:: from_str :: < StructureMessage > ( & text) {
133- let atoms: Vec < Atom > = structure_msg
134- . atoms
135- . into_iter ( )
136- . map ( |a| a. into ( ) )
137- . collect ( ) ;
140+ let atoms: Vec < Atom > = structure_msg. atoms . into_iter ( ) . map ( |a| a. into ( ) ) . collect ( ) ;
138141
139142 let _ = tx_clone. send ( UpdateStructure { atoms } ) ;
140143 }
0 commit comments