MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / deposit

Method deposit

2043-simple-bank-system.rs:32–38  ·  view source on GitHub ↗
(&mut self, account: i32, money: i64)

Source from the content-addressed store, hash-verified

30 }
31
32 fn deposit(&mut self, account: i32, money: i64) -> bool {
33 if self.balance.get(account as usize - 1) == None {
34 return false;
35 }
36 self.balance[account as usize - 1] += money;
37 true
38 }
39
40 fn withdraw(&mut self, account: i32, money: i64) -> bool {
41 if self.balance.get(account as usize - 1) == None {

Callers 1

mainFunction · 0.80

Calls 1

getMethod · 0.80

Tested by

no test coverage detected