fix a few warnings when checking with all features
This commit is contained in:
1 parent
0ef29b7d75
commit
6879507652
3 files changed
+1
-42
No files matched your search
@@ -289,17 +289,9 @@ pub trait HistoryProvider<R: Routable> {
|
|||||||
pub(crate) trait AnyHistoryProvider {
|
pub(crate) trait AnyHistoryProvider {
|
||||||
fn parse_route(&self, route: &str) -> Result<Rc<dyn Any>, String>;
|
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]
|
#[must_use]
|
||||||
fn current_route(&self) -> Rc<dyn Any>;
|
fn current_route(&self) -> Rc<dyn Any>;
|
||||||
|
|
||||||
#[must_use]
|
|
||||||
fn current_prefix(&self) -> Option<String> {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
fn can_go_back(&self) -> bool {
|
fn can_go_back(&self) -> bool {
|
||||||
true
|
true
|
||||||
@@ -359,19 +351,11 @@ where
|
|||||||
.map(|route| Rc::new(route) as Rc<dyn Any>)
|
.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> {
|
fn current_route(&self) -> Rc<dyn Any> {
|
||||||
let route = self.inner.current_route();
|
let route = self.inner.current_route();
|
||||||
Rc::new(route)
|
Rc::new(route)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn current_prefix(&self) -> Option<String> {
|
|
||||||
self.inner.current_prefix()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn can_go_back(&self) -> bool {
|
fn can_go_back(&self) -> bool {
|
||||||
self.inner.can_go_back()
|
self.inner.can_go_back()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
/// A type erased map of the site structure.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct SiteMapSegment {
|
pub struct SiteMapSegment {
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get the default history provider for the current platform.
|
/// 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>
|
fn default_history<R: Routable + Clone>(initial_route: R) -> Box<dyn AnyHistoryProvider>
|
||||||
where
|
where
|
||||||
<R as std::str::FromStr>::Err: std::fmt::Display,
|
<R as std::str::FromStr>::Err: std::fmt::Display,
|
||||||
|
|||||||
Reference in new issue
Block a user