pub fn apply_witness(&mut self, witness: &Witness) {
        let new_payment = match *self {
            Plan::After(ref cond, ref payment) if cond.is_satisfied(witness) => Some(payment),
            Plan::Race((ref cond, ref payment), _) if cond.is_satisfied(witness) => Some(payment),
            Plan::Race(_, (ref cond, ref payment)) if cond.is_satisfied(witness) => Some(payment),
            _ => None,
        }.cloned();

        if let Some(payment) = new_payment {
            mem::replace(self, Plan::Pay(payment));
        }
    }
/// Apply a witness to the spending plan to see if the plan can be reduced.
/// If so, modify the plan in-place.
Apply a witness to the spending plan to see if the plan can be reduced.
If so, modify the plan in-place.
Apply a witness to the spending plan to see if the plan can be reduced . If so modify the plan in - place .
pub fn apply_witness(&mut self, witness: &Witness) {
        let new_payment = match *self {
            Plan::After(ref cond, ref payment) if cond.is_satisfied(witness) => Some(payment),
            Plan::Race((ref cond, ref payment), _) if cond.is_satisfied(witness) => Some(payment),
            Plan::Race(_, (ref cond, ref payment)) if cond.is_satisfied(witness) => Some(payment),
            _ => None,
        }.cloned();
        if let Some(payment) = new_payment {
            mem::replace(self, Plan::Pay(payment));
        }
    }
pub fn apply_witness ( & mut self , witness : & Witness ) { let new_payment = match * self { Plan :: After ( ref cond , ref payment ) if cond . is_satisfied ( witness ) => Some ( payment ) , Plan :: Race ( ( ref cond , ref payment ) , _ ) if cond . is_satisfied ( witness ) => Some ( payment ) , Plan :: Race ( _ , ( ref cond , ref payment ) ) if cond . is_satisfied ( witness ) => Some ( payment ) , _ => None , } . cloned ( ) ; if let Some ( payment ) = new_payment { mem :: replace ( self , Plan :: Pay ( payment ) ) ; } }
Apply a witness to the spending plan to see if the plan can be reduced.
Apply a witness to the spending plan to see if the plan can be reduced .
&mut self
witness
&Witness
&mut self
witness
&Witness