@@ -138,7 +138,11 @@ impl PromptTemplateManager {
138138 self . load_from_directory_with_debug ( dir_path, true )
139139 }
140140
141- pub fn load_from_directory_with_debug ( & mut self , dir_path : & str , debug_mode : bool ) -> Result < usize > {
141+ pub fn load_from_directory_with_debug (
142+ & mut self ,
143+ dir_path : & str ,
144+ debug_mode : bool ,
145+ ) -> Result < usize > {
142146 self . template_dirs . push ( dir_path. to_string ( ) ) ;
143147
144148 let dir = Path :: new ( dir_path) ;
@@ -579,7 +583,7 @@ mod tests {
579583 fn test_template_loading ( ) {
580584 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
581585 let temp_path = temp_dir. path ( ) ;
582-
586+
583587 // Create a simple template file for testing
584588 let template_content = r#"id: test_template
585589name: Test Template
@@ -603,10 +607,10 @@ version: 1.0.0
603607enabled: true
604608metadata: {}
605609"# ;
606-
610+
607611 let template_file = temp_path. join ( "test_template.yaml" ) ;
608612 std:: fs:: write ( & template_file, template_content) . unwrap ( ) ;
609-
613+
610614 let mut manager = PromptTemplateManager :: new ( ) ;
611615
612616 let loaded = manager
@@ -621,16 +625,16 @@ metadata: {}
621625 #[ test]
622626 fn test_template_rendering ( ) {
623627 let mut manager = PromptTemplateManager :: new ( ) ;
624-
628+
625629 // Load from the actual templates directory
626630 let templates_dir = "templates/ai_prompts" ;
627631 let loaded = manager. load_from_directory ( templates_dir) . unwrap_or ( 0 ) ;
628-
632+
629633 // If no templates in the actual directory, create a test template
630634 if loaded == 0 {
631635 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
632636 let temp_path = temp_dir. path ( ) ;
633-
637+
634638 // Create the specific template the test expects
635639 let template_content = r#"id: deeplogic_economic_exploit
636640name: DeepLogic Economic Exploit Analysis
@@ -659,11 +663,13 @@ version: 1.0.0
659663enabled: true
660664metadata: {}
661665"# ;
662-
666+
663667 let template_file = temp_path. join ( "deeplogic_economic_exploit.yaml" ) ;
664668 std:: fs:: write ( & template_file, template_content) . unwrap ( ) ;
665-
666- manager. load_from_directory ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) ) . unwrap ( ) ;
669+
670+ manager
671+ . load_from_directory ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) )
672+ . unwrap ( ) ;
667673 }
668674
669675 let mut variables = HashMap :: new ( ) ;
0 commit comments