From c2054151bacef1a2fd8ff83e4206c52e903488df Mon Sep 17 00:00:00 2001 From: Daniel Carl Jones Date: Fri, 29 Dec 2023 12:24:48 +0000 Subject: [PATCH 1/2] Appease clippy Making changes based on new clippy rules. Changes are seen for the following update: stable-x86_64-apple-darwin updated - rustc 1.75.0 (82e1608df 2023-12-21) (from rustc 1.74.1 (a28077b28 2023-12-04)) Signed-off-by: Daniel Carl Jones --- mountpoint-s3/src/inode.rs | 4 ++-- mountpoint-s3/tests/reftests/reference.rs | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mountpoint-s3/src/inode.rs b/mountpoint-s3/src/inode.rs index bb761745a..c0a6f5183 100644 --- a/mountpoint-s3/src/inode.rs +++ b/mountpoint-s3/src/inode.rs @@ -711,14 +711,14 @@ impl SuperblockInner { let found_directory = if result .common_prefixes - .get(0) + .first() .map(|prefix| prefix.starts_with(&full_path_suffixed)) .unwrap_or(false) { true } else if result .objects - .get(0) + .first() .map(|object| object.key.starts_with(&full_path_suffixed)) .unwrap_or(false) { diff --git a/mountpoint-s3/tests/reftests/reference.rs b/mountpoint-s3/tests/reftests/reference.rs index 848b2c412..52c17eb81 100644 --- a/mountpoint-s3/tests/reftests/reference.rs +++ b/mountpoint-s3/tests/reftests/reference.rs @@ -141,7 +141,11 @@ impl Reference { pub fn new(remote_keys: Vec<(String, MockObject)>) -> Self { let local_files = vec![]; let local_directories = vec![]; - let materialized = build_reference(remote_keys.iter().map(|(k, o)| (k, o))); + let remote_key_iter = remote_keys.iter().map(|(k, o): &(String, MockObject)| { + let tuple_of_refs: (&String, &MockObject) = (k, o); + tuple_of_refs + }); + let materialized = build_reference(remote_key_iter); Self { remote_keys: remote_keys.into_iter().collect(), local_files, From 2ea88e1df2757dd6c197866a1a012842e953640e Mon Sep 17 00:00:00 2001 From: Daniel Carl Jones Date: Tue, 2 Jan 2024 10:03:54 +0000 Subject: [PATCH 2/2] Simplify tuple ref mapping Co-authored-by: Alessandro Passaro Signed-off-by: Daniel Carl Jones --- mountpoint-s3/tests/reftests/reference.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mountpoint-s3/tests/reftests/reference.rs b/mountpoint-s3/tests/reftests/reference.rs index 52c17eb81..87d7c51fb 100644 --- a/mountpoint-s3/tests/reftests/reference.rs +++ b/mountpoint-s3/tests/reftests/reference.rs @@ -141,11 +141,7 @@ impl Reference { pub fn new(remote_keys: Vec<(String, MockObject)>) -> Self { let local_files = vec![]; let local_directories = vec![]; - let remote_key_iter = remote_keys.iter().map(|(k, o): &(String, MockObject)| { - let tuple_of_refs: (&String, &MockObject) = (k, o); - tuple_of_refs - }); - let materialized = build_reference(remote_key_iter); + let materialized = build_reference(remote_keys.iter().map(|(k, o): &(_, _)| (k, o))); Self { remote_keys: remote_keys.into_iter().collect(), local_files,