From bd3e9d87b8fdefb61ecb8377fd84c2ebfc4a53ed Mon Sep 17 00:00:00 2001 From: atoll Date: Tue, 7 Feb 2023 19:56:36 -0800 Subject: [PATCH] fix clippy uninlined_format_args for rust 1.67.0 --- src/storage/loader/filesystem.rs | 2 +- src/storage/name.rs | 2 +- src/storage/saver/filesystem.rs | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/storage/loader/filesystem.rs b/src/storage/loader/filesystem.rs index 5326354..eb6051d 100644 --- a/src/storage/loader/filesystem.rs +++ b/src/storage/loader/filesystem.rs @@ -14,7 +14,7 @@ impl Loader for FilesystemLoader { fn load(&self, name: &str, prefix: &str, bucket: &str) -> BoxFuture, Error>> { info!("reading file in bucket '{}'", bucket); - let path = self.path.join(bucket).join(format!("{}-{}", prefix, name)); + let path = self.path.join(bucket).join(format!("{prefix}-{name}")); Box::pin(async move { Ok(fs::read(path).await?) }) } diff --git a/src/storage/name.rs b/src/storage/name.rs index df5f024..d9de254 100644 --- a/src/storage/name.rs +++ b/src/storage/name.rs @@ -110,7 +110,7 @@ mod test { let uuid = "9e697947-2990-4182-b080-533c16af4799"; let display = &Display::Staff; let name = ExternalFileName::from_uuid_and_display(uuid, display).filename(); - println!("{}", name); + println!("{name}"); let external_file_name = ExternalFileName::from_uri(&name)?; assert_eq!( external_file_name.internal.uuid_hash, diff --git a/src/storage/saver/filesystem.rs b/src/storage/saver/filesystem.rs index 48826ea..e4825d1 100644 --- a/src/storage/saver/filesystem.rs +++ b/src/storage/saver/filesystem.rs @@ -27,7 +27,7 @@ impl Saver for FilesystemSaver { let path = self.path.clone().join(bucket); info!("saving permanent file in {}", path.display()); - let file_name = format!("{}-{}", prefix, name); + let file_name = format!("{prefix}-{name}"); Box::pin(async move { match fs::create_dir_all(path.clone()).await { @@ -53,7 +53,7 @@ impl Saver for FilesystemSaver { } fn delete(&self, name: &str, prefix: &str, bucket: &str) -> BoxFuture> { - let path = self.path.join(bucket).join(format!("{}-{}", prefix, name)); + let path = self.path.join(bucket).join(format!("{prefix}-{name}")); let name = name.to_owned(); let bucket = bucket.to_owned(); @@ -92,7 +92,7 @@ impl Saver for FilesystemSaver { let path = self.path.join(bucket); let file_uuid = Uuid::new_v4().to_simple().to_string(); - let file_name = format!("tmp-{}", file_uuid); + let file_name = format!("tmp-{file_uuid}"); Box::pin(async move { match fs::create_dir_all(path.clone()).await { @@ -176,7 +176,7 @@ mod tests { let delete_result = saver.delete("hello.txt", "pre", BUCKET).await; - eprintln!("{:?}", delete_result); + eprintln!("{delete_result:?}"); // make sure that the file was successfully deleted assert!(delete_result.is_ok()); @@ -220,7 +220,7 @@ mod tests { std::fs::write( std::env::temp_dir() .join(BUCKET) - .join(format!("{}-{}", PREFIX, name)), + .join(format!("{PREFIX}-{name}")), content, ) .unwrap(); @@ -238,7 +238,7 @@ mod tests { ) .await; - eprintln!("{:?}", delete_result); + eprintln!("{delete_result:?}"); assert!(delete_result.is_ok()); // make sure all the files were deleted @@ -246,7 +246,7 @@ mod tests { let metadata_result = std::fs::metadata( std::env::temp_dir() .join(BUCKET) - .join(format!("{}-{}", PREFIX, name)), + .join(format!("{PREFIX}-{name}")), ); assert!(metadata_result.is_err());