@@ -572,11 +572,12 @@ mod tests {
572572 async fn test_static_files_with_newlines ( ) {
573573 // Create the file we want to test against ad-hoc. We can't check it in as otherwise
574574 // Windows can't even checkout this repository.
575- let tmpdir = tempfile:: tempdir ( ) . unwrap ( ) ;
576- let file_with_newlines = tmpdir . path ( ) . join ( "test\n newline.text" ) ;
575+ let temp_dir = tempfile:: tempdir ( ) . unwrap ( ) ;
576+ let file_with_newlines = temp_dir . path ( ) . join ( "test\n newline.text" ) ;
577577 fs:: write ( & file_with_newlines, "Look at my newlines" ) . unwrap ( ) ;
578+
578579 let srv = test:: init_service (
579- App :: new ( ) . service ( Files :: new ( "" , tmpdir . path ( ) ) . index_file ( "Cargo.toml" ) ) ,
580+ App :: new ( ) . service ( Files :: new ( "/ " , temp_dir . path ( ) ) . index_file ( "Cargo.toml" ) ) ,
580581 )
581582 . await ;
582583 let request = TestRequest :: get ( ) . uri ( "/test%0Anewline.text" ) . to_request ( ) ;
@@ -860,7 +861,7 @@ mod tests {
860861
861862 #[ actix_rt:: test]
862863 async fn test_percent_encoding_2 ( ) {
863- let tmpdir = tempfile:: tempdir ( ) . unwrap ( ) ;
864+ let temp_dir = tempfile:: tempdir ( ) . unwrap ( ) ;
864865 let filename = match cfg ! ( unix) {
865866 true => "ض:?#[]{}<>()@!$&'`|*+,;= %20\n .test" ,
866867 false => "ض#[]{}()@!$&'`+,;= %20.test" ,
@@ -872,9 +873,9 @@ mod tests {
872873 write ! ( & mut buf, "%{:02X}" , c) . unwrap ( ) ;
873874 buf
874875 } ) ;
875- std:: fs:: File :: create ( tmpdir . path ( ) . join ( filename) ) . unwrap ( ) ;
876+ std:: fs:: File :: create ( temp_dir . path ( ) . join ( filename) ) . unwrap ( ) ;
876877
877- let srv = test:: init_service ( App :: new ( ) . service ( Files :: new ( "" , tmpdir . path ( ) ) ) ) . await ;
878+ let srv = test:: init_service ( App :: new ( ) . service ( Files :: new ( "/ " , temp_dir . path ( ) ) ) ) . await ;
878879
879880 let req = TestRequest :: get ( )
880881 . uri ( & format ! ( "/{}" , filename_encoded) )
0 commit comments