Much cleaner with impl walkable but don't know if I can loop yet

This commit is contained in:
Tom Alexander 2020-04-11 21:51:12 -04:00
parent 110b03fc45
commit ec3276af79
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 2 additions and 5 deletions

View File

@ -148,10 +148,7 @@ mod tests {
}
}
fn do_the_walk<'a, O: Walkable>(
context: &'a dyn Walkable<Output = O>,
path: &Vec<&str>,
) -> &'a impl Walkable {
fn do_the_walk<'a>(context: &'a impl Walkable, path: &Vec<&str>) -> &'a impl Walkable {
let mut output = context;
context.walk(path.first().unwrap())

View File

@ -1,7 +1,7 @@
use super::renderable::Renderable;
pub trait Walkable {
type Output: ?Sized + Walkable;
type Output: Walkable;
fn walk(&self, segment: &str) -> &Self::Output;