working on two levels
This commit is contained in:
parent
d5c3985c29
commit
7ace4be3c7
@ -120,6 +120,14 @@ mod tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> Walkable for str {
|
||||||
|
type Output = str;
|
||||||
|
|
||||||
|
fn walk(&self, segment: &str) -> &str {
|
||||||
|
panic!("Tried to walk down a str");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_walk_path() {
|
fn test_walk_path() {
|
||||||
let context: HashMap<&str, &str> = [
|
let context: HashMap<&str, &str> = [
|
||||||
|
7
src/renderer/walkable.rs
Normal file
7
src/renderer/walkable.rs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
use super::renderable::Renderable;
|
||||||
|
|
||||||
|
pub trait Walkable {
|
||||||
|
type Output: ?Sized + Walkable;
|
||||||
|
|
||||||
|
fn walk(&self, segment: &str) -> &Self::Output;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user