diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2022-11-15 15:14:48 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2022-11-15 15:15:06 -0500 |
commit | 87ede1e2b367a997440626ad9f583600d7cc42fc (patch) | |
tree | a3fd0008714e6d524c2e3b967734a0cfb6cf6cbd /webapp/src/components | |
parent | 1f623cca3ea0937508b8c50f4c32a0972271e8f4 (diff) |
Fix rust warnings
Diffstat (limited to 'webapp/src/components')
-rw-r--r-- | webapp/src/components/app_context_provider.rs | 6 | ||||
-rw-r--r-- | webapp/src/components/game.rs | 6 | ||||
-rw-r--r-- | webapp/src/components/table.rs | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/webapp/src/components/app_context_provider.rs b/webapp/src/components/app_context_provider.rs index 0b490fc..bba7e33 100644 --- a/webapp/src/components/app_context_provider.rs +++ b/webapp/src/components/app_context_provider.rs @@ -4,7 +4,7 @@ use gloo_net::http::Request; use log::info; use protocol::UserInfo; use uuid::Uuid; -use std::{future::Future, rc::Rc}; +use std::future::Future; use wasm_bindgen_futures::spawn_local; use yew::prelude::*; use yew_router::prelude::*; @@ -110,7 +110,7 @@ pub fn use_app_context() -> AppContext { let state : AppState = use_context::<AppState>().unwrap(); let history = use_history().unwrap(); - AppContext { state: state, history } + AppContext { state, history } } #[function_component(AppContextProvider)] @@ -127,7 +127,7 @@ pub fn app_context_provider(props: &Props) -> Html { match initialize_user_info().await { Ok(user_info) => user.set(Some(user_info)), Err(e) => error.set(Some(ErrorInfoProperties { - message: format!("Could not contact server"), + message: format!("Could not contact server: {:?}", e), })), }; }); diff --git a/webapp/src/components/game.rs b/webapp/src/components/game.rs index 7ade948..45ad035 100644 --- a/webapp/src/components/game.rs +++ b/webapp/src/components/game.rs @@ -77,7 +77,7 @@ pub fn game() -> Html { contract, bidding, }), - Ok(DealInPlayResult::PlayFinished(tricks)) => todo!(), + Ok(DealInPlayResult::PlayFinished(_tricks)) => todo!(), }; } }) @@ -110,8 +110,8 @@ pub fn game() -> Html { } GameState::Play { playing_deal, - contract, - bidding, + contract: _, + bidding: _, } => { html! { <> diff --git a/webapp/src/components/table.rs b/webapp/src/components/table.rs index b8da804..bccbfe4 100644 --- a/webapp/src/components/table.rs +++ b/webapp/src/components/table.rs @@ -1,6 +1,5 @@ use log::info; use yew::prelude::*; -use yew_router::prelude::*; use crate::use_app_context; @@ -8,9 +7,10 @@ use crate::use_app_context; pub fn table(props: &TableProps) -> Html { let ctx = use_app_context(); - let table_state: UseStateHandle<Option<protocol::TableView>> = use_state(|| None); + // let table_state: UseStateHandle<Option<protocol::TableView>> = use_state(|| None); { - let table_state = table_state.clone(); + // TODO update this from server state + // let table_state = table_state.clone(); let ctx = ctx.clone(); ctx.spawn_async(async move { info!("Getting table state"); |