fn steal<T>(src: &Queue<T>, dest: &Queue<T>) {
    // Half of `src`'s length rounded up.
    let mut count = (src.len() + 1) / 2;
    if count > 0 {
        // Don't steal more than fits into the queue.
        count = count.min(dest.capacity() - dest.len());
        for _ in 0..count {
            if let Some(t) = src.pop() {
                dest.push(t);
            } else {
                break;
            }
        }
    }
}
/// Steals some items from one queue into another.
Steals some items from one queue into another.
Steals some items from one queue into another .
fn steal<T>(src: &Queue<T>, dest: &Queue<T>) {
    // Half of `src`'s length rounded up.
    let mut count = (src.len() + 1) / 2;
    if count > 0 {
        // Don't steal more than fits into the queue.
        count = count.min(dest.capacity() - dest.len());
        for _ in 0..count {
            if let Some(t) = src.pop() {
                dest.push(t);
            } else {
                break;
            }
        }
    }
}
fn steal < T > ( src : & Queue < T > , dest : & Queue < T > ) { // Half of `src`'s length rounded up. let mut count = ( src . len ( ) + 1 ) / 2 ; if count > 0 { // Don't steal more than fits into the queue. count = count . min ( dest . capacity ( ) - dest . len ( ) ) ; for _ in 0 .. count { if let Some ( t ) = src . pop ( ) { dest . push ( t ) ; } else { break ; } } } }
Steals some items from one queue into another.
Steals some items from one queue into another .
src
&Queue<T>
dest
&Queue<T>
src
&Queue<T>
dest
&Queue<T>