From f3d16ffe629b40376253d434377645c5cc510094 Mon Sep 17 00:00:00 2001 From: gix-bot <107688624+gix-bot@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:02:14 +0100 Subject: [PATCH] Update rust version (#2139) Co-authored-by: gix-bot --- rust-toolchain.toml | 2 +- src/archive/tests/tests.rs | 20 +++++++++---------- .../tests/integration/archive_integration.rs | 8 ++++---- src/vc_util/src/lib.rs | 10 +++------- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 6b9ac7bc20..bdbeb14b06 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.73.0" +channel = "1.75.0" targets = ["wasm32-unknown-unknown"] diff --git a/src/archive/tests/tests.rs b/src/archive/tests/tests.rs index ae97e7b3f5..ec4a616f05 100644 --- a/src/archive/tests/tests.rs +++ b/src/archive/tests/tests.rs @@ -38,7 +38,7 @@ fn should_keep_entries_across_upgrades() -> Result<(), CallError> { let logs = api::get_entries(&env, canister_id, None, None)?; assert_eq!(logs.entries.len(), 1); - assert_eq!(logs.entries.get(0).unwrap().as_ref().unwrap(), &entry); + assert_eq!(logs.entries.first().unwrap().as_ref().unwrap(), &entry); let user_logs = api::get_anchor_entries(&env, canister_id, ANCHOR_NUMBER_1, None, None)?; assert_eq!(user_logs.entries.len(), 1); Ok(()) @@ -84,7 +84,7 @@ mod rollback_tests { let logs = api::get_entries(&env, canister_id, None, None)?; assert_eq!(logs.entries.len(), 1); assert_eq!( - CompatEntry::from(logs.entries.get(0).unwrap().clone().unwrap()), + CompatEntry::from(logs.entries.first().unwrap().clone().unwrap()), entry ); Ok(()) @@ -121,7 +121,7 @@ mod rollback_tests { let logs = api::get_entries(&env, canister_id, None, None)?; assert_eq!(logs.entries.len(), 2); assert_eq!( - CompatEntry::from(logs.entries.get(0).unwrap().clone().unwrap()), + CompatEntry::from(logs.entries.first().unwrap().clone().unwrap()), entry1 ); assert_eq!( @@ -216,7 +216,7 @@ mod read_tests { let logs = api::get_entries(&env, canister_id, None, None)?; assert_eq!(logs.entries.len(), 1); assert_eq!( - logs.entries.get(0).unwrap().as_ref().unwrap(), + logs.entries.first().unwrap().as_ref().unwrap(), &log_entry_1() ); Ok(()) @@ -251,14 +251,14 @@ mod read_tests { let user_1_logs = api::get_anchor_entries(&env, canister_id, ANCHOR_NUMBER_1, None, None)?; assert_eq!(user_1_logs.entries.len(), 1); assert_eq!( - user_1_logs.entries.get(0).unwrap().as_ref().unwrap(), + user_1_logs.entries.first().unwrap().as_ref().unwrap(), &log_entry_1() ); let user_2_logs = api::get_anchor_entries(&env, canister_id, ANCHOR_NUMBER_2, None, None)?; assert_eq!(user_2_logs.entries.len(), 1); assert_eq!( - user_2_logs.entries.get(0).unwrap().as_ref().unwrap(), + user_2_logs.entries.first().unwrap().as_ref().unwrap(), &log_entry_2() ); @@ -319,7 +319,7 @@ mod read_tests { assert_eq!(logs.entries.len(), 2); assert_eq!( logs.entries - .get(0) + .first() .unwrap() .as_ref() .unwrap() @@ -404,7 +404,7 @@ mod read_tests { )?; assert_eq!(logs.entries.len(), 2); assert_eq!( - logs.entries.get(0).unwrap().as_ref().unwrap(), + logs.entries.first().unwrap().as_ref().unwrap(), &log_entry_2() ); assert_eq!( @@ -449,7 +449,7 @@ mod read_tests { let logs = api::get_anchor_entries(&env, canister_id, ANCHOR_NUMBER_1, None, None)?; assert_eq!(logs.entries.len(), 3); - assert_eq!(logs.entries.get(0).unwrap().as_ref().unwrap().timestamp, 1); + assert_eq!(logs.entries.first().unwrap().as_ref().unwrap().timestamp, 1); assert_eq!( logs.entries.get(1).unwrap().as_ref().unwrap().timestamp, 1u64 << 8 @@ -749,7 +749,7 @@ mod stable_memory_tests { sequence_number: 0, }; assert_eq!( - entries.entries.get(0).unwrap().as_ref().unwrap(), + entries.entries.first().unwrap().as_ref().unwrap(), ®ister_entry ); diff --git a/src/internet_identity/tests/integration/archive_integration.rs b/src/internet_identity/tests/integration/archive_integration.rs index 1850fca81b..4f2f4e85f5 100644 --- a/src/internet_identity/tests/integration/archive_integration.rs +++ b/src/internet_identity/tests/integration/archive_integration.rs @@ -261,7 +261,7 @@ mod pull_entries_tests { sequence_number: 0, }; assert_eq!( - entries.entries.get(0).unwrap().as_ref().unwrap(), + entries.entries.first().unwrap().as_ref().unwrap(), ®ister_entry ); @@ -375,7 +375,7 @@ mod pull_entries_tests { sequence_number: 0, }; assert_eq!( - entries.entries.get(0).unwrap().as_ref().unwrap(), + entries.entries.first().unwrap().as_ref().unwrap(), &expected_register_entry ); @@ -506,7 +506,7 @@ mod pull_entries_tests { sequence_number: 0, }; assert_eq!( - entries.entries.get(0).unwrap().as_ref().unwrap(), + entries.entries.first().unwrap().as_ref().unwrap(), &expected_metadata_entry ); @@ -715,7 +715,7 @@ mod pull_entries_tests { message: format!("Canister {} is stopped", ii_canister.to_text()), }; assert_eq!( - status.call_info.call_errors.get(0).unwrap(), + status.call_info.call_errors.first().unwrap(), &expected_error ); Ok(()) diff --git a/src/vc_util/src/lib.rs b/src/vc_util/src/lib.rs index 824f7e9fdd..3be5786176 100644 --- a/src/vc_util/src/lib.rs +++ b/src/vc_util/src/lib.rs @@ -212,13 +212,9 @@ pub fn verify_ii_presentation_jwt_with_canister_ids( "expected exactly two verifiable credentials".to_string(), )); } - let id_alias_vc_jws = - presentation - .verifiable_credential - .get(0) - .ok_or(PresentationVerificationError::Unknown( - "missing id_alias vc".to_string(), - ))?; + let id_alias_vc_jws = presentation.verifiable_credential.first().ok_or( + PresentationVerificationError::Unknown("missing id_alias vc".to_string()), + )?; let alias_tuple = get_verified_id_alias_from_jws( id_alias_vc_jws.as_str(), &vc_flow_signers.ii_canister_id,