fn _get_next_loan_id_and_increase(&mut self) -> Result<Id, PSP721Error> {
            if self.freed_ids.len() > 0 {
                return Ok(self.freed_ids.pop().unwrap())
            }
            let mut current = self.last_loan_id;
            // It is not fully correct implementation of the increasing. but it is only an example
            for n in 0..32 {
                if current[n] == u8::MAX {
                    if n == 31 {
                        return Err(PSP721Error::Custom(String::from("Max Id reached!")))
                    } else {
                        current[n] = 0;
                    }
                } else {
                    current[n] += 1;
                    break
                }
            }
            self.last_loan_id = current;
            Ok(current)
        }
/// internal function to return the id of a new loan and to increase it in the storage
internal function to return the id of a new loan and to increase it in the storage
internal function to return the id of a new loan and to increase it in the storage
fn _get_next_loan_id_and_increase(&mut self) -> Result<Id, PSP721Error> {
            if self.freed_ids.len() > 0 {
                return Ok(self.freed_ids.pop().unwrap())
            }
            let mut current = self.last_loan_id;
            // It is not fully correct implementation of the increasing. but it is only an example
            for n in 0..32 {
                if current[n] == u8::MAX {
                    if n == 31 {
                        return Err(PSP721Error::Custom(String::from("Max Id reached!")))
                    } else {
                        current[n] = 0;
                    }
                } else {
                    current[n] += 1;
                    break
                }
            }
            self.last_loan_id = current;
            Ok(current)
        }
fn _get_next_loan_id_and_increase ( & mut self ) -> Result < Id , PSP721Error > { if self . freed_ids . len ( ) > 0 { return Ok ( self . freed_ids . pop ( ) . unwrap ( ) ) } let mut current = self . last_loan_id ; // It is not fully correct implementation of the increasing. but it is only an example for n in 0 .. 32 { if current [ n ] == u8 :: MAX { if n == 31 { return Err ( PSP721Error :: Custom ( String :: from ( " " ) ) ) } else { current [ n ] = 0 ; } } else { current [ n ] += 1 ; break } } self . last_loan_id = current ; Ok ( current ) }
internal function to return the id of a new loan and to increase it in the storage
internal function to return the id of a new loan and to increase it in the storage
&mut self
&mut self