pub fn credit(&mut self, to: &AccountIdentifier, amount: Tokens) {
        self.store
            .update(*to, |prev| -> Result<Tokens, std::convert::Infallible> {
                // NB. credit cannot overflow unless there is a bug in the
                // system: the total amount of tokens in the circulation cannot
                // exceed u64::MAX, so it's impossible to have more than
                // u64::MAX tokens on a single account.
                Ok((amount + *prev.unwrap_or(&Tokens::ZERO)).expect("bug: overflow in credit"))
            })
            .unwrap();
    }
// Crediting an account will automatically add it to the `inner` HashMap if
// not already present.
Crediting an account will automatically add it to the `inner` HashMap if
not already present.
Crediting an account will automatically add it to the ` inner ` HashMap if not already present .
pub fn credit(&mut self, to: &AccountIdentifier, amount: Tokens) {
        self.store
            .update(*to, |prev| -> Result<Tokens, std::convert::Infallible> {
                // NB. credit cannot overflow unless there is a bug in the
                // system: the total amount of tokens in the circulation cannot
                // exceed u64::MAX, so it's impossible to have more than
                // u64::MAX tokens on a single account.
                Ok((amount + *prev.unwrap_or(&Tokens::ZERO)).expect("bug: overflow in credit"))
            })
            .unwrap();
    }
pub fn credit ( & mut self , to : & AccountIdentifier , amount : Tokens ) { self . store . update ( * to , | prev | -> Result < Tokens , std :: convert :: Infallible > { // NB. credit cannot overflow unless there is a bug in the // system: the total amount of tokens in the circulation cannot // exceed u64::MAX, so it's impossible to have more than // u64::MAX tokens on a single account. Ok ( ( amount + * prev . unwrap_or ( & Tokens :: ZERO ) ) . expect ( " " ) ) } ) . unwrap ( ) ; }
Crediting an account will automatically add it to the `inner` HashMap if
not already present.
Crediting an account will automatically add it to the ` inner ` HashMap if not already present .
&mut self
to
&AccountIdentifier
amount
Tokens
&mut self
to
&AccountIdentifier
amount
Tokens