From 6879507652189ab5573e1312ab0183c570c46c8c Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 16 Feb 2024 09:09:35 -0600 Subject: [PATCH] fix a few warnings when checking with all features --- packages/router/src/history/mod.rs | 16 ---------------- packages/router/src/routable.rs | 26 -------------------------- packages/router/src/router_cfg.rs | 1 + 3 files changed, 1 insertion(+), 42 deletions(-) diff --git a/packages/router/src/history/mod.rs b/packages/router/src/history/mod.rs index 18ee092e6..8043184fb 100644 --- a/packages/router/src/history/mod.rs +++ b/packages/router/src/history/mod.rs @@ -289,17 +289,9 @@ pub trait HistoryProvider { pub(crate) trait AnyHistoryProvider { fn parse_route(&self, route: &str) -> Result, String>; - #[must_use] - fn accepts_type_id(&self, type_id: &std::any::TypeId) -> bool; - #[must_use] fn current_route(&self) -> Rc; - #[must_use] - fn current_prefix(&self) -> Option { - None - } - #[must_use] fn can_go_back(&self) -> bool { true @@ -359,19 +351,11 @@ where .map(|route| Rc::new(route) as Rc) } - fn accepts_type_id(&self, type_id: &std::any::TypeId) -> bool { - type_id == &std::any::TypeId::of::() - } - fn current_route(&self) -> Rc { let route = self.inner.current_route(); Rc::new(route) } - fn current_prefix(&self) -> Option { - self.inner.current_prefix() - } - fn can_go_back(&self) -> bool { self.inner.can_go_back() } diff --git a/packages/router/src/routable.rs b/packages/router/src/routable.rs index 7037355ca..fc4a86ad1 100644 --- a/packages/router/src/routable.rs +++ b/packages/router/src/routable.rs @@ -311,32 +311,6 @@ pub trait Routable: FromStr + Display + Clone + 'static { } } -trait RoutableFactory { - type Err: Display; - type Routable: Routable + FromStr; -} - -impl RoutableFactory for R -where - ::Err: Display, -{ - type Err = ::Err; - type Routable = R; -} - -trait RouteRenderable: Display + 'static { - fn render(&self, level: usize) -> Element; -} - -impl RouteRenderable for R -where - ::Err: Display, -{ - fn render(&self, level: usize) -> Element { - self.render(level) - } -} - /// A type erased map of the site structure. #[derive(Debug, Clone, PartialEq)] pub struct SiteMapSegment { diff --git a/packages/router/src/router_cfg.rs b/packages/router/src/router_cfg.rs index f71b7cbf3..559c72393 100644 --- a/packages/router/src/router_cfg.rs +++ b/packages/router/src/router_cfg.rs @@ -117,6 +117,7 @@ where } /// Get the default history provider for the current platform. +#[allow(unreachable_code, unused)] fn default_history(initial_route: R) -> Box where ::Err: std::fmt::Display,