Skip to content

Commit d7d08f6

Browse files
author
Llorenç
committed
Fix formatting
1 parent 09b0a4f commit d7d08f6

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

src/internet_identity/src/storage.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -823,27 +823,27 @@ impl<M: Memory + Clone> Storage<M> {
823823
}
824824

825825
/// Search for an account and account_reference and applies the function `f` if found.
826-
///
827-
///
826+
///
827+
///
828828
/// The function `f` is called with a mutable reference to the account reference and an option to the mutable reference to the account.
829-
///
829+
///
830830
/// # Arguments
831-
///
831+
///
832832
/// * `anchor_number` - The anchor number of the account.
833833
/// * `application_number` - The application number of the account.
834834
/// * `account_number` - The account number of the account or None if synthetic account.
835835
/// * `f` - The function to apply to the account.
836-
///
836+
///
837837
/// If the `account_number` is None, storable account doesn't exist and account reference might exist.
838838
/// * If the account reference exists, the function `f` is called with a mutable reference to the account reference and None as the second argument.
839839
/// * If the account reference does not exist, None is returned.
840-
///
840+
///
841841
/// If the `account_number` is Some, storable and account references exist.
842842
/// * If the storable account exists, the function `f` is called with a mutable reference to the account reference and a mutable reference to the storable account.
843843
/// * If the storable account does not exist, None is returned.
844-
///
844+
///
845845
/// # Returns
846-
///
846+
///
847847
/// * `None` if both account and account_reference are not found
848848
/// * `Some(T)` if the account or account_reference are found where T is the result of the function `f`.
849849
fn with_account_mut<T, F>(
@@ -876,7 +876,7 @@ impl<M: Memory + Clone> Storage<M> {
876876
self.stable_account_reference_list_memory.insert(key, value);
877877

878878
result
879-
},
879+
}
880880
Some(account_number) => {
881881
// Account should be stored, otherwise, it was removed and we'll return `None`.
882882
let mut storable_account = self.stable_account_memory.get(&account_number)?;
@@ -895,7 +895,8 @@ impl<M: Memory + Clone> Storage<M> {
895895
let value = StorableAccountReferenceList::from_vec(account_references);
896896

897897
self.stable_account_reference_list_memory.insert(key, value);
898-
self.stable_account_memory.insert(account_number, storable_account);
898+
self.stable_account_memory
899+
.insert(account_number, storable_account);
899900

900901
result
901902
}

src/internet_identity/tests/integration/accounts.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,8 +1077,7 @@ fn should_update_last_used_after_prepare_account_delegation() -> Result<(), Reje
10771077
.expect("Account should exist in the list");
10781078

10791079
assert_eq!(
1080-
account_before.last_used,
1081-
None,
1080+
account_before.last_used, None,
10821081
"last_used should be None before prepare_account_delegation"
10831082
);
10841083

@@ -1186,7 +1185,9 @@ fn should_update_last_used_independently_for_different_accounts() -> Result<(),
11861185
);
11871186

11881187
let time_before_account_1 = env.get_time().as_nanos_since_unix_epoch();
1189-
prepare_account_delegation(&params_1, None).unwrap().unwrap();
1188+
prepare_account_delegation(&params_1, None)
1189+
.unwrap()
1190+
.unwrap();
11901191
let time_after_account_1 = env.get_time().as_nanos_since_unix_epoch();
11911192

11921193
// Retrieve accounts and verify account_1 has last_used set, account_2 still has None
@@ -1217,8 +1218,7 @@ fn should_update_last_used_independently_for_different_accounts() -> Result<(),
12171218
let account_1_last_used = account_1_after_first.last_used.unwrap();
12181219

12191220
assert_eq!(
1220-
account_2_after_first.last_used,
1221-
None,
1221+
account_2_after_first.last_used, None,
12221222
"account_2 last_used should still be None after only account_1 delegation"
12231223
);
12241224

@@ -1245,7 +1245,9 @@ fn should_update_last_used_independently_for_different_accounts() -> Result<(),
12451245
);
12461246

12471247
let time_before_account_2 = env.get_time().as_nanos_since_unix_epoch();
1248-
prepare_account_delegation(&params_2, None).unwrap().unwrap();
1248+
prepare_account_delegation(&params_2, None)
1249+
.unwrap()
1250+
.unwrap();
12491251
let time_after_account_2 = env.get_time().as_nanos_since_unix_epoch();
12501252

12511253
// Retrieve accounts and verify both have last_used set, but account_1's hasn't changed

0 commit comments

Comments
 (0)