Much cleaner with impl walkable but don't know if I can loop yet
This commit is contained in:
		
							parent
							
								
									110b03fc45
								
							
						
					
					
						commit
						ec3276af79
					
				| @ -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()) | ||||
|  | ||||
| @ -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; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander