@@ -7,8 +7,8 @@ use super::*;
77use crate :: bug_message;
88use handlebars:: { self , Handlebars } ;
99use mime_guess:: MimeGuess ;
10- use std:: collections:: hash_map:: Entry ;
1110use std:: collections:: HashMap ;
11+ use std:: collections:: hash_map:: Entry ;
1212use std:: path:: Path ;
1313use std:: sync:: { Arc , RwLock } ;
1414use thiserror:: Error ;
@@ -149,13 +149,13 @@ where
149149 return Err ( ContentLoadingError :: ContentFileNameError ( format ! (
150150 "Content file name '{}' has too many extensions." ,
151151 entry. relative_path
152- ) ) )
152+ ) ) ) ;
153153 }
154154 [ ] => {
155155 return Err ( ContentLoadingError :: ContentFileNameError ( format ! (
156156 "Content file names must have extensions, but '{}' does not." ,
157157 entry. relative_path
158- ) ) )
158+ ) ) ) ;
159159 }
160160 }
161161 }
@@ -222,14 +222,12 @@ where
222222 // have the executable bit set. They are evaluated when rendered.
223223 [ first_extension, Self :: HANDLEBARS_FILE_EXTENSION ] => {
224224 if content. is_executable {
225- return Err ( ContentLoadingError :: ContentFileNameError (
226- format ! (
227- "The content file '{}' appears to be a handlebars file (because it ends in '.{}'), \
225+ return Err ( ContentLoadingError :: ContentFileNameError ( format ! (
226+ "The content file '{}' appears to be a handlebars file (because it ends in '.{}'), \
228227 but it is also executable. It must be one or the other.",
229- content. relative_path,
230- Self :: HANDLEBARS_FILE_EXTENSION ,
231- ) ,
232- ) ) ;
228+ content. relative_path,
229+ Self :: HANDLEBARS_FILE_EXTENSION ,
230+ ) ) ) ;
233231 }
234232
235233 let mime = MimeGuess :: from_ext ( first_extension)
@@ -480,12 +478,9 @@ mod tests {
480478 let actual_output = media_to_string ( rendered) ;
481479
482480 assert_eq ! (
483- actual_output,
484- expected_output,
481+ actual_output, expected_output,
485482 "Template rendering for `{}` did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
486- template,
487- expected_output,
488- actual_output,
483+ template, expected_output, actual_output,
489484 ) ;
490485 }
491486 }
@@ -539,12 +534,9 @@ mod tests {
539534 let actual_output = media_to_string ( rendered) ;
540535
541536 assert_eq ! (
542- actual_output,
543- expected_output,
537+ actual_output, expected_output,
544538 "Template rendering for `{}` did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
545- template,
546- expected_output,
547- actual_output,
539+ template, expected_output, actual_output,
548540 ) ;
549541 }
550542
@@ -573,12 +565,9 @@ mod tests {
573565 let actual_output = media_to_string ( rendered) ;
574566
575567 assert_eq ! (
576- actual_output,
577- expected_output,
568+ actual_output, expected_output,
578569 "Rendering content at '{}' did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
579- route,
580- expected_output,
581- actual_output,
570+ route, expected_output, actual_output,
582571 ) ;
583572 }
584573
@@ -639,12 +628,9 @@ mod tests {
639628 let actual_output = media_to_string ( rendered) ;
640629
641630 assert_eq ! (
642- actual_output,
643- expected_output,
631+ actual_output, expected_output,
644632 "Template rendering for `{}` did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
645- template,
646- expected_output,
647- actual_output,
633+ template, expected_output, actual_output,
648634 ) ;
649635 }
650636
@@ -709,12 +695,9 @@ mod tests {
709695 let actual_output = media_to_string ( rendered) ;
710696
711697 assert_eq ! (
712- actual_output,
713- expected_output,
698+ actual_output, expected_output,
714699 "Template rendering for `{}` did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
715- template,
716- expected_output,
717- actual_output,
700+ template, expected_output, actual_output,
718701 ) ;
719702 }
720703
@@ -750,12 +733,9 @@ mod tests {
750733 let actual_output = media_to_string ( rendered) ;
751734
752735 assert_eq ! (
753- actual_output,
754- expected_output,
736+ actual_output, expected_output,
755737 "Template rendering for `{}` did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
756- template,
757- expected_output,
758- actual_output,
738+ template, expected_output, actual_output,
759739 ) ;
760740 }
761741
@@ -949,12 +929,9 @@ mod tests {
949929 let actual_output = media_to_string ( rendered) ;
950930
951931 assert_eq ! (
952- actual_output,
953- expected_output,
932+ actual_output, expected_output,
954933 "Rendering content at '{}' did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
955- route,
956- expected_output,
957- actual_output,
934+ route, expected_output, actual_output,
958935 ) ;
959936 }
960937
@@ -980,12 +957,9 @@ mod tests {
980957 let actual_output = media_to_string ( rendered) ;
981958
982959 assert_eq ! (
983- actual_output,
984- expected_output1,
960+ actual_output, expected_output1,
985961 "Rendering content at '{}' did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
986- route1,
987- expected_output1,
988- actual_output,
962+ route1, expected_output1, actual_output,
989963 ) ;
990964
991965 let route2 = route ( "/subdirectory/pwd" ) ;
@@ -1003,12 +977,9 @@ mod tests {
1003977 let actual_output = media_to_string ( rendered) ;
1004978
1005979 assert_eq ! (
1006- actual_output,
1007- expected_output2,
980+ actual_output, expected_output2,
1008981 "Rendering content at '{}' did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
1009- route2,
1010- expected_output2,
1011- actual_output,
982+ route2, expected_output2, actual_output,
1012983 ) ;
1013984 }
1014985
@@ -1099,12 +1070,9 @@ mod tests {
10991070 let actual_output = media_to_string ( rendered) ;
11001071
11011072 assert_eq ! (
1102- actual_output,
1103- expected_output,
1073+ actual_output, expected_output,
11041074 "Rendering content at '{}' did not produce the expected output (\" {}\" ), instead got \" {}\" " ,
1105- route,
1106- expected_output,
1107- actual_output,
1075+ route, expected_output, actual_output,
11081076 ) ;
11091077 }
11101078
0 commit comments