Add tests for explicit context setting that check failure conditions and implement a helper function to generate a new breadcrumb stack.
This commit is contained in:
@@ -42,6 +42,12 @@ where
|
||||
B: Borrow<dyn ContextElement + 'a>,
|
||||
P: Borrow<str>,
|
||||
{
|
||||
if breadcrumbs.is_empty() {
|
||||
// This happens when you use a section with an explicit
|
||||
// context path, where both the path and the explicit context
|
||||
// path fail, leaving you with absolutely no context.
|
||||
return Err(WalkError::CantWalk);
|
||||
}
|
||||
if path.is_empty() {
|
||||
return Ok(breadcrumbs
|
||||
.last()
|
||||
|
||||
Reference in New Issue
Block a user