/*
	We can't use a generic Vec<T> implementation for these two functions
	because TLS 1.3 encodes length differently depending on the max length
	of the vector. If the cap is <= 255, it only uses one byte, but otherwise
	uses two bytes. I think this is really silly but oh well
*/
We can't use a generic Vec implementation for these two functions
because TLS 1.3 encodes length differently depending on the max length
of the vector. If the cap is <= 255, it only uses one byte, but otherwise
uses two bytes. I think this is really silly but oh well
We can ' t use a generic Vec implementation for these two functions because TLS 1 . 3 encodes length differently depending on the max length of the vector . If the cap is < = 255 it only uses one byte but otherwise uses two bytes . I think this is really silly but oh well
fn u16_vector_as_bytes<T>(data : &Vec<T>) -> Vec<u8> where T:TLSToBytes {
	let mut ret : Vec<u8> = vec![];
	ret.write_u16::<NetworkEndian>(data.len() as u16).unwrap();
	for x in data.iter() {
		ret.extend(x.as_bytes());
	}
	ret
}
fn u16_vector_as_bytes < T > ( data : & Vec < T > ) -> Vec < u8 > where T : TLSToBytes { let mut ret : Vec < u8 > = vec ! [ ] ; ret . write_u16 :: < NetworkEndian > ( data . len ( ) as u16 ) . unwrap ( ) ; for x in data . iter ( ) { ret . extend ( x . as_bytes ( ) ) ; } ret }
We can't use a generic Vec<T> implementation for these two functions
because TLS 1.3 encodes length differently depending on the max length
of the vector.
We can ' t use a generic Vec<T > implementation for these two functions because TLS 1 . 3 encodes length differently depending on the max length of the vector .
data
&Vec<T>