fn _liquidate_loan(&mut self, loan_id: Id) -> Result<(), PSP721Error> {
            let loan_info = self.loan_info.get(&loan_id);

            if loan_info.is_none() {
                return Err(PSP721Error::Custom(String::from("This loan does not exist!")))
            }

            let mut loan_info = loan_info.cloned().unwrap();
            loan_info.liquidated = true;

            self.loan_info.insert(loan_id, loan_info);

            Ok(())
        }
/// internal function to set loan to liquidated
internal function to set loan to liquidated
internal function to set loan to liquidated
fn _liquidate_loan(&mut self, loan_id: Id) -> Result<(), PSP721Error> {
            let loan_info = self.loan_info.get(&loan_id);
            if loan_info.is_none() {
                return Err(PSP721Error::Custom(String::from("This loan does not exist!")))
            }
            let mut loan_info = loan_info.cloned().unwrap();
            loan_info.liquidated = true;
            self.loan_info.insert(loan_id, loan_info);
            Ok(())
        }
fn _liquidate_loan ( & mut self , loan_id : Id ) -> Result < ( ) , PSP721Error > { let loan_info = self . loan_info . get ( & loan_id ) ; if loan_info . is_none ( ) { return Err ( PSP721Error :: Custom ( String :: from ( " " ) ) ) } let mut loan_info = loan_info . cloned ( ) . unwrap ( ) ; loan_info . liquidated = true ; self . loan_info . insert ( loan_id , loan_info ) ; Ok ( ( ) ) }
internal function to set loan to liquidated
internal function to set loan to liquidated
&mut self
loan_id
Id
&mut self
loan_id
Id