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..87d7c51fb 100644 --- a/mountpoint-s3/tests/reftests/reference.rs +++ b/mountpoint-s3/tests/reftests/reference.rs @@ -141,7 +141,7 @@ 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 materialized = build_reference(remote_keys.iter().map(|(k, o): &(_, _)| (k, o))); Self { remote_keys: remote_keys.into_iter().collect(), local_files,