Change request for Rust v1.68.0
error: useless conversion to the same type: `std::ops::Range<i32>`
--> system/security/keystore2/tests/keystore2_client_operation_tests.rs:47:5
|
47 | / (0..max_ops)
48 | | .into_iter()
| |____________________^ help: consider removing `.into_iter()`: `(0..max_ops)`
bug: 270756468
Test: test_compiler.py
Change-Id: Ib661ecaf1f30a1e165b6fb3bde4d0fc93758891e
diff --git a/keystore2/src/shared_secret_negotiation.rs b/keystore2/src/shared_secret_negotiation.rs
index 42d38d2..81644ec 100644
--- a/keystore2/src/shared_secret_negotiation.rs
+++ b/keystore2/src/shared_secret_negotiation.rs
@@ -121,11 +121,11 @@
let mut legacy_strongbox_found: bool = false;
Ok([(4, 1), (4, 0)]
.iter()
- .map(|(ma, mi)| {
+ .flat_map(|(ma, mi)| {
get_hidl_instances(KEYMASTER_PACKAGE_NAME, *ma, *mi, KEYMASTER_INTERFACE_NAME)
- .into_iter()
+ .iter()
.filter_map(|name| {
- filter_map_legacy_km_instances(name, (*ma, *mi)).and_then(|sp| {
+ filter_map_legacy_km_instances(name.to_string(), (*ma, *mi)).and_then(|sp| {
if let SharedSecretParticipant::Hidl { is_strongbox: true, .. } = &sp {
if !legacy_strongbox_found {
legacy_strongbox_found = true;
@@ -140,8 +140,6 @@
})
.collect::<Vec<SharedSecretParticipant>>()
})
- .into_iter()
- .flatten()
.chain({
get_aidl_instances(SHARED_SECRET_PACKAGE_NAME, 1, SHARED_SECRET_INTERFACE_NAME)
.into_iter()
diff --git a/keystore2/tests/keystore2_client_operation_tests.rs b/keystore2/tests/keystore2_client_operation_tests.rs
index 9714900..19175dd 100644
--- a/keystore2/tests/keystore2_client_operation_tests.rs
+++ b/keystore2/tests/keystore2_client_operation_tests.rs
@@ -45,7 +45,6 @@
let base_gid = 99 * AID_USER_OFFSET + 10001;
let base_uid = 99 * AID_USER_OFFSET + 10001;
(0..max_ops)
- .into_iter()
.map(|i| {
execute_op_run_as_child(
target_ctx,
@@ -312,7 +311,6 @@
// Create multiple operations in this process to trigger cannibalizing sibling operations.
let mut ops: Vec<binder::Result<CreateOperationResponse>> = (0..MAX_OPS)
- .into_iter()
.map(|_| {
sec_level.createOperation(
&key_metadata.key,