pub fn linearize(c_group: &ConstraintGroup) -> Vec<Constraint> {
    let ConstraintGroup {
        init,
        mutable,
        signer,
        has_one,
        literal,
        raw,
        owner,
        rent_exempt,
        seeds,
        executable,
        state,
        associated,
        close,
        address,
    } = c_group.clone();

    let mut constraints = Vec::new();

    if let Some(c) = associated {
        constraints.push(Constraint::AssociatedGroup(c));
    }
    if let Some(c) = seeds {
        constraints.push(Constraint::Seeds(c));
    }
    if let Some(c) = init {
        constraints.push(Constraint::Init(c));
    }
    if let Some(c) = mutable {
        constraints.push(Constraint::Mut(c));
    }
    if let Some(c) = signer {
        constraints.push(Constraint::Signer(c));
    }
    constraints.append(&mut has_one.into_iter().map(Constraint::HasOne).collect());
    constraints.append(&mut literal.into_iter().map(Constraint::Literal).collect());
    constraints.append(&mut raw.into_iter().map(Constraint::Raw).collect());
    if let Some(c) = owner {
        constraints.push(Constraint::Owner(c));
    }
    if let Some(c) = rent_exempt {
        constraints.push(Constraint::RentExempt(c));
    }
    if let Some(c) = executable {
        constraints.push(Constraint::Executable(c));
    }
    if let Some(c) = state {
        constraints.push(Constraint::State(c));
    }
    if let Some(c) = close {
        constraints.push(Constraint::Close(c));
    }
    if let Some(c) = address {
        constraints.push(Constraint::Address(c));
    }
    constraints
}
// Linearizes the constraint group so that constraints with dependencies
// run after those without.
//
// The associated cosntraint should always be first since it may also create
// an account with a PDA.
Linearizes the constraint group so that constraints with dependencies
run after those without.

The associated cosntraint should always be first since it may also create
an account with a PDA.
Linearizes the constraint group so that constraints with dependencies run after those without . The associated cosntraint should always be first since it may also create an account with a PDA .
pub fn linearize(c_group: &ConstraintGroup) -> Vec<Constraint> {
    let ConstraintGroup {
        init,
        mutable,
        signer,
        has_one,
        literal,
        raw,
        owner,
        rent_exempt,
        seeds,
        executable,
        state,
        associated,
        close,
        address,
    } = c_group.clone();
    let mut constraints = Vec::new();
    if let Some(c) = associated {
        constraints.push(Constraint::AssociatedGroup(c));
    }
    if let Some(c) = seeds {
        constraints.push(Constraint::Seeds(c));
    }
    if let Some(c) = init {
        constraints.push(Constraint::Init(c));
    }
    if let Some(c) = mutable {
        constraints.push(Constraint::Mut(c));
    }
    if let Some(c) = signer {
        constraints.push(Constraint::Signer(c));
    }
    constraints.append(&mut has_one.into_iter().map(Constraint::HasOne).collect());
    constraints.append(&mut literal.into_iter().map(Constraint::Literal).collect());
    constraints.append(&mut raw.into_iter().map(Constraint::Raw).collect());
    if let Some(c) = owner {
        constraints.push(Constraint::Owner(c));
    }
    if let Some(c) = rent_exempt {
        constraints.push(Constraint::RentExempt(c));
    }
    if let Some(c) = executable {
        constraints.push(Constraint::Executable(c));
    }
    if let Some(c) = state {
        constraints.push(Constraint::State(c));
    }
    if let Some(c) = close {
        constraints.push(Constraint::Close(c));
    }
    if let Some(c) = address {
        constraints.push(Constraint::Address(c));
    }
    constraints
}
pub fn linearize ( c_group : & ConstraintGroup ) -> Vec < Constraint > { let ConstraintGroup { init , mutable , signer , has_one , literal , raw , owner , rent_exempt , seeds , executable , state , associated , close , address , } = c_group . clone ( ) ; let mut constraints = Vec :: new ( ) ; if let Some ( c ) = associated { constraints . push ( Constraint :: AssociatedGroup ( c ) ) ; } if let Some ( c ) = seeds { constraints . push ( Constraint :: Seeds ( c ) ) ; } if let Some ( c ) = init { constraints . push ( Constraint :: Init ( c ) ) ; } if let Some ( c ) = mutable { constraints . push ( Constraint :: Mut ( c ) ) ; } if let Some ( c ) = signer { constraints . push ( Constraint :: Signer ( c ) ) ; } constraints . append ( & mut has_one . into_iter ( ) . map ( Constraint :: HasOne ) . collect ( ) ) ; constraints . append ( & mut literal . into_iter ( ) . map ( Constraint :: Literal ) . collect ( ) ) ; constraints . append ( & mut raw . into_iter ( ) . map ( Constraint :: Raw ) . collect ( ) ) ; if let Some ( c ) = owner { constraints . push ( Constraint :: Owner ( c ) ) ; } if let Some ( c ) = rent_exempt { constraints . push ( Constraint :: RentExempt ( c ) ) ; } if let Some ( c ) = executable { constraints . push ( Constraint :: Executable ( c ) ) ; } if let Some ( c ) = state { constraints . push ( Constraint :: State ( c ) ) ; } if let Some ( c ) = close { constraints . push ( Constraint :: Close ( c ) ) ; } if let Some ( c ) = address { constraints . push ( Constraint :: Address ( c ) ) ; } constraints }
Linearizes the constraint group so that constraints with dependencies
run after those without.
Linearizes the constraint group so that constraints with dependencies run after those without .
c_group
&ConstraintGroup