Switched to returning an Option for into_context_element().

This commit is contained in:
Tom Alexander
2020-05-31 22:17:58 -04:00
parent 3aaf7f9987
commit b74dc394a8
3 changed files with 15 additions and 11 deletions

View File

@@ -105,7 +105,7 @@ pub trait IntoContextElement: Debug + Walkable /* + CloneIntoBoxedContextElement
&self,
renderer: &DustRenderer,
breadcrumbs: Option<&BreadcrumbTree>,
) -> &dyn ContextElement;
) -> Option<&dyn ContextElement>;
}
impl<C: ContextElement> IntoContextElement for C {
@@ -113,7 +113,7 @@ impl<C: ContextElement> IntoContextElement for C {
&self,
renderer: &DustRenderer,
breadcrumbs: Option<&BreadcrumbTree>,
) -> &dyn ContextElement {
self
) -> Option<&dyn ContextElement> {
Some(self)
}
}