From cdfa4db1c959d051cc597d1e14e11db722e1fedf Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 20 Nov 2023 19:20:15 -0800 Subject: [PATCH] crazy debug generic restrictions --- src/face_crawler.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/face_crawler.rs b/src/face_crawler.rs index 623608e..9d243c5 100644 --- a/src/face_crawler.rs +++ b/src/face_crawler.rs @@ -4,13 +4,15 @@ use crate::integer::{Time,Planar64}; use crate::zeroes::zeroes2; #[derive(Debug)] -enum Transition{ +enum Transition +where ::UndirectedEdge:std::fmt::Debug{ Miss, Next(FEV,Time), Hit(F,Time), } - fn next_transition(fev:&FEV,time:Time,mesh:&impl MeshQuery,body:&Body,time_limit:Time)->Transition{ + fn next_transition(fev:&FEV,time:Time,mesh:&impl MeshQuery,body:&Body,time_limit:Time)->Transition + where ::UndirectedEdge:std::fmt::Debug{ //conflicting derivative means it crosses in the wrong direction. //if the transition time is equal to an already tested transition, do not replace the current best. let mut best_time=time_limit; @@ -117,7 +119,8 @@ pub enum CrawlResult{ Miss(FEV), Hit(F,Time), } -pub fn crawl_fev(mut fev:FEV,mesh:&impl MeshQuery,relative_body:&Body,start_time:Time,time_limit:Time)->CrawlResult{ +pub fn crawl_fev(mut fev:FEV,mesh:&impl MeshQuery,relative_body:&Body,start_time:Time,time_limit:Time)->CrawlResult +where ::UndirectedEdge:std::fmt::Debug{ let mut time=start_time; for _ in 0..20{ println!("@ fev={:?} time={}",fev,time);