Worked around a lifetime issue with into_context_element.

This commit is contained in:
Tom Alexander
2020-05-31 22:31:05 -04:00
parent b74dc394a8
commit 064027e77b
2 changed files with 18 additions and 13 deletions

View File

@@ -101,19 +101,19 @@ impl<C: ContextElement> FromContextElement for C {
}
pub trait IntoContextElement: Debug + Walkable /* + CloneIntoBoxedContextElement*/ {
fn into_context_element(
&self,
fn into_context_element<'a>(
&'a self,
renderer: &DustRenderer,
breadcrumbs: Option<&BreadcrumbTree>,
) -> Option<&dyn ContextElement>;
breadcrumbs: Option<&'a BreadcrumbTree<'a>>,
) -> Option<&'a dyn ContextElement>;
}
impl<C: ContextElement> IntoContextElement for C {
fn into_context_element(
&self,
fn into_context_element<'a>(
&'a self,
renderer: &DustRenderer,
breadcrumbs: Option<&BreadcrumbTree>,
) -> Option<&dyn ContextElement> {
breadcrumbs: Option<&'a BreadcrumbTree<'a>>,
) -> Option<&'a dyn ContextElement> {
Some(self)
}
}