fix to isize
This commit is contained in:
parent
5c28458afd
commit
6f8eed4412
@ -9,7 +9,7 @@ impl MemActStore {
|
||||
MemActStore(HashMap::new())
|
||||
}
|
||||
|
||||
fn add_or_sub_balance(&mut self, client: &u16, amnt: usize, sub: bool) -> usize {
|
||||
fn add_or_sub_balance(&mut self, client: &u16, amnt: isize, sub: bool) -> isize {
|
||||
let act = self
|
||||
.0
|
||||
.entry(*client)
|
||||
@ -24,15 +24,15 @@ impl MemActStore {
|
||||
}
|
||||
|
||||
impl ActStore for MemActStore {
|
||||
fn add_to_balance(&mut self, client: &u16, amnt: usize) -> usize {
|
||||
fn add_to_balance(&mut self, client: &u16, amnt: isize) -> isize {
|
||||
self.add_or_sub_balance(client, amnt, false)
|
||||
}
|
||||
|
||||
fn sub_from_balance(&mut self, client: &u16, amnt: usize) -> usize {
|
||||
fn sub_from_balance(&mut self, client: &u16, amnt: isize) -> isize {
|
||||
self.add_or_sub_balance(client, amnt, true)
|
||||
}
|
||||
|
||||
fn hold_amount(&mut self, client: u16, amnt: usize) {
|
||||
fn hold_amount(&mut self, client: u16, amnt: isize) {
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,9 @@ use crate::types::Account;
|
||||
pub trait ActStore {
|
||||
|
||||
fn get_account(&self, client: &u16) -> Option<&Account>;
|
||||
fn add_to_balance(&mut self, client: &u16, amnt: usize) -> usize;
|
||||
fn sub_from_balance(&mut self, client: &u16, amnt: usize) -> usize;
|
||||
fn hold_amount(&mut self, client:u16, amnt: usize);
|
||||
fn add_to_balance(&mut self, client: &u16, amnt: isize) -> isize;
|
||||
fn sub_from_balance(&mut self, client: &u16, amnt: isize) -> isize;
|
||||
fn hold_amount(&mut self, client:u16, amnt: isize);
|
||||
fn lock_account(&mut self, client: u16);
|
||||
fn unlock_account(&mut self, client: u16);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user