fn ensure_property(&self, p: fn(&CodecOp) -> bool) -> (Vec<CodecOp>, Vec<CodecOp>) {
        let mut ops = self.ops.clone();
        let mut property_preserving = Vec::new();
        while let Some(op) = ops.pop() {
            if !p(&op) {
                ops.push(op);
                property_preserving.reverse();
                return (ops, property_preserving);
            }
            property_preserving.push(op);
            for _ in 1..op.arg_count() {
                Codec::pop_push(&mut ops, &mut property_preserving);
            }
        }
        (ops, property_preserving)
    }
/// Splits up the CodecOps into two sequences.
/// The first sequence is the minimum number of `CodecOp`s that have to be executed to restore property `p`.
/// The second sequence is the remaining operations required for full decoding.
Splits up the CodecOps into two sequences.
The first sequence is the minimum number of `CodecOp`s that have to be executed to restore property `p`.
The second sequence is the remaining operations required for full decoding.
Splits up the CodecOps into two sequences . The first sequence is the minimum number of ` CodecOp ` s that have to be executed to restore property ` p ` . The second sequence is the remaining operations required for full decoding .
fn ensure_property(&self, p: fn(&CodecOp) -> bool) -> (Vec<CodecOp>, Vec<CodecOp>) {
        let mut ops = self.ops.clone();
        let mut property_preserving = Vec::new();
        while let Some(op) = ops.pop() {
            if !p(&op) {
                ops.push(op);
                property_preserving.reverse();
                return (ops, property_preserving);
            }
            property_preserving.push(op);
            for _ in 1..op.arg_count() {
                Codec::pop_push(&mut ops, &mut property_preserving);
            }
        }
        (ops, property_preserving)
    }
fn ensure_property ( & self , p : fn ( & CodecOp ) -> bool ) -> ( Vec < CodecOp > , Vec < CodecOp > ) { let mut ops = self . ops . clone ( ) ; let mut property_preserving = Vec :: new ( ) ; while let Some ( op ) = ops . pop ( ) { if ! p ( & op ) { ops . push ( op ) ; property_preserving . reverse ( ) ; return ( ops , property_preserving ) ; } property_preserving . push ( op ) ; for _ in 1 .. op . arg_count ( ) { Codec :: pop_push ( & mut ops , & mut property_preserving ) ; } } ( ops , property_preserving ) }
Splits up the CodecOps into two sequences.
Splits up the CodecOps into two sequences .
&self
p
fn(&CodecOp) -> bool
&self
p
fn(&CodecOp) -> bool