File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
src/internet_identity/src/storage/storable Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,17 @@ impl StorableAccountsCounter {
23
23
pub fn increment ( & self , account_type : & AccountType ) -> Self {
24
24
match account_type {
25
25
AccountType :: AccountReference => Self {
26
- stored_account_references : self . stored_account_references + 1 ,
26
+ stored_account_references : self
27
+ . stored_account_references
28
+ . checked_add ( 1 )
29
+ . expect ( "overflow in stored_account_references" ) ,
27
30
stored_accounts : self . stored_accounts ,
28
31
} ,
29
32
AccountType :: Account => Self {
30
- stored_accounts : self . stored_accounts + 1 ,
33
+ stored_accounts : self
34
+ . stored_accounts
35
+ . checked_add ( 1 )
36
+ . expect ( "overflow in stored_accounts" ) ,
31
37
stored_account_references : self . stored_account_references ,
32
38
} ,
33
39
}
Original file line number Diff line number Diff line change @@ -28,7 +28,10 @@ impl StorableDiscrepancyCounter {
28
28
pub fn increment ( & self , discrepancy_type : & DiscrepancyType ) -> Self {
29
29
match discrepancy_type {
30
30
DiscrepancyType :: AccountRebuild => Self {
31
- account_counter_rebuilds : self . account_counter_rebuilds + 1 ,
31
+ account_counter_rebuilds : self
32
+ . account_counter_rebuilds
33
+ . checked_add ( 1 )
34
+ . expect ( "overflow in account_counter_rebuilds" ) ,
32
35
} ,
33
36
}
34
37
}
You can’t perform that action at this time.
0 commit comments