@@ -4,7 +4,10 @@ use std::{collections::HashSet, fmt::Debug, marker::PhantomData};
44use stdweb:: {
55 js,
66 unstable:: TryFrom ,
7- web:: { event:: PopStateEvent , window, EventListenerHandle , History , IEventTarget , Location } ,
7+ web:: {
8+ event:: PopStateEvent , window, EventListenerHandle , History ,
9+ IEventTarget , Location ,
10+ } ,
811 JsSerialize , Value ,
912} ;
1013use yew:: { callback:: Callback , prelude:: worker:: * } ;
4245 /// of its stack when the forward or back buttons are pressed.
4346 pub fn register_callback ( & mut self , callback : Callback < ( ) > ) {
4447 self . event_listener =
45- Some ( window ( ) . add_event_listener ( move |_event : PopStateEvent | callback. emit ( ( ) ) ) ) ;
48+ Some ( window ( ) . add_event_listener ( move |_event : PopStateEvent | {
49+ callback. emit ( ( ) )
50+ } ) ) ;
4651 }
4752
4853 /// Sets the browser's url bar to contain the provided route, and creates a
@@ -140,7 +145,8 @@ where
140145 pub fn current_route ( route_service : & RouterService < T > ) -> Fallible < Self > {
141146 // guaranteed to always start with a '/'
142147 let path = route_service. get_path ( ) ?;
143- let mut path_segments: Vec < String > = path. split ( '/' ) . map ( String :: from) . collect ( ) ;
148+ let mut path_segments: Vec < String > =
149+ path. split ( '/' ) . map ( String :: from) . collect ( ) ;
144150 // remove empty string that is split from the first '/'
145151 path_segments. remove ( 0 ) ;
146152
@@ -188,7 +194,10 @@ pub enum Request<T> {
188194 GetCurrentRoute ,
189195}
190196
191- impl < T > Transferable for Request < T > where for < ' de > T : Serialize + Deserialize < ' de > { }
197+ impl < T > Transferable for Request < T > where
198+ for < ' de > T : Serialize + Deserialize < ' de >
199+ {
200+ }
192201
193202/// The RouterAgent worker holds on to the RouterService singleton and mediates
194203/// access to it.
0 commit comments