pub fn remove_user_rps_by_farm(&mut self, farm_id: FarmId) -> bool {
        let sender_id = env::predecessor_account_id();
        let mut farmer = self.get_farmer(&sender_id);
        let (seed_id, _) = parse_farm_id(&farm_id);
        let farm_seed = self.get_seed(&seed_id);
        if !farm_seed.get_ref().farms.contains(&farm_id) {
            farmer.get_ref_mut().remove_rps(&farm_id);
            self.data_mut().farmers.insert(&sender_id, &farmer);
            true
        } else {
            false
        }
    }
/// Clean invalid rps,
/// return false if the rps is still valid.
Clean invalid rps,
return false if the rps is still valid.
Clean invalid rps return false if the rps is still valid .
pub fn remove_user_rps_by_farm(&mut self, farm_id: FarmId) -> bool {
        let sender_id = env::predecessor_account_id();
        let mut farmer = self.get_farmer(&sender_id);
        let (seed_id, _) = parse_farm_id(&farm_id);
        let farm_seed = self.get_seed(&seed_id);
        if !farm_seed.get_ref().farms.contains(&farm_id) {
            farmer.get_ref_mut().remove_rps(&farm_id);
            self.data_mut().farmers.insert(&sender_id, &farmer);
            true
        } else {
            false
        }
    }
pub fn remove_user_rps_by_farm ( & mut self , farm_id : FarmId ) -> bool { let sender_id = env :: predecessor_account_id ( ) ; let mut farmer = self . get_farmer ( & sender_id ) ; let ( seed_id , _ ) = parse_farm_id ( & farm_id ) ; let farm_seed = self . get_seed ( & seed_id ) ; if ! farm_seed . get_ref ( ) . farms . contains ( & farm_id ) { farmer . get_ref_mut ( ) . remove_rps ( & farm_id ) ; self . data_mut ( ) . farmers . insert ( & sender_id , & farmer ) ; true } else { false } }
Clean invalid rps,
return false if the rps is still valid.
Clean invalid rps return false if the rps is still valid .
&mut self
farm_id
FarmId
&mut self
farm_id
FarmId