Sfoglia il codice sorgente

fix a few warnings when checking with all features

Evan Almloff 1 anno fa
parent
commit
6879507652

+ 0 - 16
packages/router/src/history/mod.rs

@@ -289,17 +289,9 @@ pub trait HistoryProvider<R: Routable> {
 pub(crate) trait AnyHistoryProvider {
     fn parse_route(&self, route: &str) -> Result<Rc<dyn Any>, String>;
 
-    #[must_use]
-    fn accepts_type_id(&self, type_id: &std::any::TypeId) -> bool;
-
     #[must_use]
     fn current_route(&self) -> Rc<dyn Any>;
 
-    #[must_use]
-    fn current_prefix(&self) -> Option<String> {
-        None
-    }
-
     #[must_use]
     fn can_go_back(&self) -> bool {
         true
@@ -359,19 +351,11 @@ where
             .map(|route| Rc::new(route) as Rc<dyn Any>)
     }
 
-    fn accepts_type_id(&self, type_id: &std::any::TypeId) -> bool {
-        type_id == &std::any::TypeId::of::<R>()
-    }
-
     fn current_route(&self) -> Rc<dyn Any> {
         let route = self.inner.current_route();
         Rc::new(route)
     }
 
-    fn current_prefix(&self) -> Option<String> {
-        self.inner.current_prefix()
-    }
-
     fn can_go_back(&self) -> bool {
         self.inner.can_go_back()
     }

+ 0 - 26
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<Err = Self::Err>;
-}
-
-impl<R: Routable + FromStr> RoutableFactory for R
-where
-    <R as FromStr>::Err: Display,
-{
-    type Err = <R as FromStr>::Err;
-    type Routable = R;
-}
-
-trait RouteRenderable: Display + 'static {
-    fn render(&self, level: usize) -> Element;
-}
-
-impl<R: Routable> RouteRenderable for R
-where
-    <R as FromStr>::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 {

+ 1 - 0
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<R: Routable + Clone>(initial_route: R) -> Box<dyn AnyHistoryProvider>
 where
     <R as std::str::FromStr>::Err: std::fmt::Display,