fn act_upon_meta_code<I: Iterator<Item=u8>>(results:&mut Vec<u4>, bitreader:&mut Bits<I>, code:u16) -> Result<(), InflateError> {
	if code < 16 {
		results.push(u4::truncate(code as u8));
	} else if code == 16 {
		let prev_code = results[results.len() - 1];
		let times = 3 + option_to_result(bitreader.read_n_rev(u4::_2))?;
		for _ in 0..times {
			results.push(prev_code);
		}
	} else if code == 17 {
		let times = 3 + option_to_result(bitreader.read_n_rev(u4::_3))?;
		for _ in 0..times {
			results.push(u4::_0);
		}
	} else if code == 18 {
		let times = 11 + option_to_result(bitreader.read_n_rev(u4::_7))?;
		for _ in 0..times {
			results.push(u4::_0);
		}
	} else {
		panic!("Illegal meta code: {}", code);
	}
	Ok(())
}
/// Appends values to the results vector based on the provided meta code, and possibly the next few bits in the bitreader.
Appends values to the results vector based on the provided meta code, and possibly the next few bits in the bitreader.
Appends values to the results vector based on the provided meta code and possibly the next few bits in the bitreader .
fn act_upon_meta_code<I: Iterator<Item=u8>>(results:&mut Vec<u4>, bitreader:&mut Bits<I>, code:u16) -> Result<(), InflateError> {
	if code < 16 {
		results.push(u4::truncate(code as u8));
	} else if code == 16 {
		let prev_code = results[results.len() - 1];
		let times = 3 + option_to_result(bitreader.read_n_rev(u4::_2))?;
		for _ in 0..times {
			results.push(prev_code);
		}
	} else if code == 17 {
		let times = 3 + option_to_result(bitreader.read_n_rev(u4::_3))?;
		for _ in 0..times {
			results.push(u4::_0);
		}
	} else if code == 18 {
		let times = 11 + option_to_result(bitreader.read_n_rev(u4::_7))?;
		for _ in 0..times {
			results.push(u4::_0);
		}
	} else {
		panic!("Illegal meta code: {}", code);
	}
	Ok(())
}
fn act_upon_meta_code < I : Iterator < Item = u8 > > ( results : & mut Vec < u4 > , bitreader : & mut Bits < I > , code : u16 ) -> Result < ( ) , InflateError > { if code < 16 { results . push ( u4 :: truncate ( code as u8 ) ) ; } else if code == 16 { let prev_code = results [ results . len ( ) - 1 ] ; let times = 3 + option_to_result ( bitreader . read_n_rev ( u4 :: _2 ) ) ? ; for _ in 0 .. times { results . push ( prev_code ) ; } } else if code == 17 { let times = 3 + option_to_result ( bitreader . read_n_rev ( u4 :: _3 ) ) ? ; for _ in 0 .. times { results . push ( u4 :: _0 ) ; } } else if code == 18 { let times = 11 + option_to_result ( bitreader . read_n_rev ( u4 :: _7 ) ) ? ; for _ in 0 .. times { results . push ( u4 :: _0 ) ; } } else { panic ! ( " " code ) ; } Ok ( ( ) ) }
Appends values to the results vector based on the provided meta code, and possibly the next few bits in the bitreader.
Appends values to the results vector based on the provided meta code and possibly the next few bits in the bitreader .
results
&mut Vec<u4>
bitreader
&mut Bits<I>
code
u16