fix a few warnings when checking with all features

This commit is contained in:
Evan Almloff 2024-02-16 09:09:35 -06:00
parent 0ef29b7d75
commit 6879507652
3 changed files with 1 additions and 42 deletions

View file

@ -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()
}

View file

@ -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 {

View file

@ -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,