Skip to content

Commit

Permalink
Fix syntax err
Browse files Browse the repository at this point in the history
  • Loading branch information
chinedufn committed May 26, 2023
1 parent 324fb6d commit 21fd9ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/isomorphic/app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn download_contributors_json(store: Provided<Rc<RefCell<Store>>>) {
// @book end on-visit-example

fn make_router(store: Rc<RefCell<Store>>) -> Rc<Router> {
let mut router = Router::new(create_routes![home_route, contributors_route]);
let router = Router::new(create_routes![home_route, contributors_route]);
router.provide(store);

Rc::new(router)
Expand Down
8 changes: 4 additions & 4 deletions examples/isomorphic/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl Client {
pub fn new(initial_state: &str) -> Client {
// In a real app you'd typically uncomment this line
// #[cfg(debug_assertions)]
console_log::init_with_level(Level::Debug);
console_log::init_with_level(Level::Debug).unwrap();

console_error_panic_hook::set_once();

Expand All @@ -64,8 +64,8 @@ impl Client {

store.borrow_mut().msg(&Msg::SetPath(path))
};
let on_popstate = Box::new(on_popstate) as Box<FnMut(_)>;
let mut on_popstate = Closure::wrap(on_popstate);
let on_popstate = Box::new(on_popstate) as Box<dyn FnMut(_)>;
let on_popstate = Closure::wrap(on_popstate);
window().set_onpopstate(Some(on_popstate.as_ref().unchecked_ref()));
on_popstate.forget();

Expand Down Expand Up @@ -118,7 +118,7 @@ fn intercept_relative_links(store: Rc<RefCell<Store>>) {
}
}
};
let on_anchor_click = Closure::wrap(Box::new(on_anchor_click) as Box<FnMut(_)>);
let on_anchor_click = Closure::wrap(Box::new(on_anchor_click) as Box<dyn FnMut(_)>);

window()
.add_event_listener_with_callback("click", on_anchor_click.as_ref().unchecked_ref())
Expand Down

0 comments on commit 21fd9ae

Please sign in to comment.