aboutsummaryrefslogtreecommitdiffstats
path: root/tests/upload_files.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/upload_files.rs')
-rw-r--r--tests/upload_files.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/upload_files.rs b/tests/upload_files.rs
index 196f3cd..8cb3e8e 100644
--- a/tests/upload_files.rs
+++ b/tests/upload_files.rs
@@ -189,7 +189,8 @@ fn prevent_path_traversal_attacks(
create_dir_all(server.path().join("foo")).unwrap();
if !cfg!(windows) {
for dir in &["C:/foo/C:", r"C:\foo", r"\foo"] {
- create_dir_all(server.path().join(dir)).expect(&format!("failed to create: {:?}", dir));
+ create_dir_all(server.path().join(dir))
+ .unwrap_or_else(|_| panic!("failed to create: {dir:?}"));
}
}
@@ -203,7 +204,7 @@ fn prevent_path_traversal_attacks(
let form = multipart::Form::new().part("file_to_upload", part);
Client::new()
- .post(server.url().join(&format!("/upload?path={}", path))?)
+ .post(server.url().join(&format!("/upload?path={path}"))?)
.multipart(form)
.send()?
.error_for_status()?;
@@ -243,7 +244,7 @@ fn upload_to_symlink_directory(
let form = multipart::Form::new().part("file_to_upload", part);
let status = Client::new()
- .post(server.url().join(&format!("/upload?path={}", dir))?)
+ .post(server.url().join(&format!("/upload?path={dir}"))?)
.multipart(form)
.send()?
.error_for_status();