fn extract_statics(stmts: Vec<Stmt>) -> (Statics, Vec<Stmt>) {
    let mut istmts = stmts.into_iter();

    let mut statics = Statics::new();
    let mut stmts = vec![];
    while let Some(stmt) = istmts.next() {
        match stmt {
            Stmt::Item(Item::Static(var)) => {
                if var.mutability.is_some() {
                    statics.push(var);
                } else {
                    stmts.push(Stmt::Item(Item::Static(var)));
                    break;
                }
            }
            _ => {
                stmts.push(stmt);
                break;
            }
        }
    }

    stmts.extend(istmts);

    (statics, stmts)
}
/// Extracts `static mut` vars from the beginning of the given statements
Extracts `static mut` vars from the beginning of the given statements
Extracts ` static mut ` vars from the beginning of the given statements
fn extract_statics(stmts: Vec<Stmt>) -> (Statics, Vec<Stmt>) {
    let mut istmts = stmts.into_iter();
    let mut statics = Statics::new();
    let mut stmts = vec![];
    while let Some(stmt) = istmts.next() {
        match stmt {
            Stmt::Item(Item::Static(var)) => {
                if var.mutability.is_some() {
                    statics.push(var);
                } else {
                    stmts.push(Stmt::Item(Item::Static(var)));
                    break;
                }
            }
            _ => {
                stmts.push(stmt);
                break;
            }
        }
    }
    stmts.extend(istmts);
    (statics, stmts)
}
fn extract_statics ( stmts : Vec < Stmt > ) -> ( Statics , Vec < Stmt > ) { let mut istmts = stmts . into_iter ( ) ; let mut statics = Statics :: new ( ) ; let mut stmts = vec ! [ ] ; while let Some ( stmt ) = istmts . next ( ) { match stmt { Stmt :: Item ( Item :: Static ( var ) ) => { if var . mutability . is_some ( ) { statics . push ( var ) ; } else { stmts . push ( Stmt :: Item ( Item :: Static ( var ) ) ) ; break ; } } _ => { stmts . push ( stmt ) ; break ; } } } stmts . extend ( istmts ) ; ( statics , stmts ) }
Extracts `static mut` vars from the beginning of the given statements
Extracts ` static mut ` vars from the beginning of the given statements
stmts
Vec<Stmt>
stmts
Vec<Stmt>