Skip to content

Commit

Permalink
fix clippy uninlined_format_args for rust 1.67.0
Browse files Browse the repository at this point in the history
  • Loading branch information
floatingatoll committed Feb 8, 2023
1 parent 2c57559 commit bd3e9d8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/storage/loader/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl Loader for FilesystemLoader {
fn load(&self, name: &str, prefix: &str, bucket: &str) -> BoxFuture<Result<Vec<u8>, 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?) })
}
Expand Down
2 changes: 1 addition & 1 deletion src/storage/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions src/storage/saver/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -53,7 +53,7 @@ impl Saver for FilesystemSaver {
}

fn delete(&self, name: &str, prefix: &str, bucket: &str) -> BoxFuture<Result<(), Error>> {
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();
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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();
Expand All @@ -238,15 +238,15 @@ mod tests {
)
.await;

eprintln!("{:?}", delete_result);
eprintln!("{delete_result:?}");
assert!(delete_result.is_ok());

// make sure all the files were deleted
for (name, _content) in test_files.clone() {
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());
Expand Down

0 comments on commit bd3e9d8

Please sign in to comment.