cleanup: a bunch of warnings

This commit is contained in:
Jeremy Wall 2024-07-11 18:28:45 -04:00
parent 61112c4e64
commit fe181fb102
6 changed files with 8 additions and 22 deletions

View File

@ -22,6 +22,7 @@ use tracing::{debug, instrument};
use super::RecipeEntry;
#[allow(dead_code)]
#[derive(Debug)]
pub struct Error(String);

View File

@ -30,6 +30,7 @@ use crate::{
js_lib,
};
#[allow(dead_code)]
#[derive(Debug)]
pub struct Error(String);

View File

@ -25,16 +25,6 @@ pub mod shopping_list;
pub mod staples;
pub mod tabs;
pub use add_recipe::*;
pub use categories::*;
pub use footer::*;
pub use header::*;
pub use number_field::*;
pub use plan_list::*;
pub use recipe::*;
pub use recipe_list::*;
pub use recipe_plan::*;
pub use recipe_selection::*;
pub use shopping_list::*;
pub use staples::*;
pub use tabs::*;

View File

@ -16,9 +16,7 @@ use sycamore::prelude::*;
use tracing::{debug, error};
use wasm_bindgen::{JsCast, JsValue};
use wasm_web_component::{web_component, WebComponentBinding};
use web_sys::{window, CustomEvent, CustomEventInit, Event, HtmlElement, InputEvent, ShadowRoot};
use crate::js_lib::LogFailures;
use web_sys::{CustomEvent, CustomEventInit, Event, HtmlElement, InputEvent, ShadowRoot};
#[web_component(
observed_attrs = "['val', 'min', 'max', 'step']",
@ -135,10 +133,10 @@ impl WebComponentBinding for NumberSpinner {
return;
}
};
let mut eventDict = CustomEventInit::new();
eventDict.detail(&JsValue::from_f64(self.value as f64));
let mut event_dict = CustomEventInit::new();
event_dict.detail(&JsValue::from_f64(self.value as f64));
element
.dispatch_event(&CustomEvent::new_with_event_init_dict("updated", &eventDict).unwrap())
.dispatch_event(&CustomEvent::new_with_event_init_dict("updated", &event_dict).unwrap())
.unwrap();
debug!("Dispatched updated event");
}

View File

@ -38,7 +38,7 @@ pub fn SelectPage<'ctx, G: Html>(cx: Scope<'ctx>, sh: StateHandler<'ctx>) -> Vie
view! {cx,
PlanningPage(
selected=Some("Select".to_owned()),
plan_date = current_plan.clone(),
plan_date = current_plan,
) {
PlanList(sh=sh, list=plan_dates)
button(on:click=move |_| {

View File

@ -12,11 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::{
app_state::StateHandler,
components::{Footer, Header},
pages::*,
};
use crate::{app_state::StateHandler, components::Header, pages::*};
use sycamore::prelude::*;
use sycamore_router::{HistoryIntegration, Route, Router};
use tracing::{debug, instrument};