diff --git a/src/face_crawler.rs b/src/face_crawler.rs index 0a50370..e454629 100644 --- a/src/face_crawler.rs +++ b/src/face_crawler.rs @@ -107,11 +107,12 @@ pub enum CrawlResult{ } pub fn crawl_fev(mut fev:FEV,mesh:&impl MeshQuery,relative_body:&Body,start_time:Time,time_limit:Time)->CrawlResult{ let mut time=start_time; - loop{ + for _ in 0..10{ match next_transition(&fev,time,mesh,relative_body,time_limit){ Transition::Miss=>return CrawlResult::Miss(fev), Transition::Next(next_fev,next_time)=>(fev,time)=(next_fev,next_time), Transition::Hit(face,time)=>return CrawlResult::Hit(face,time), } } + panic!("Too many iterations!"); }