pub fn serialize_uint<S>(slice: &mut [u8], bytes: &[u8], serializer: S) -> Result<S::Ok, S::Error>
where
	S: Serializer,
{
	let non_zero = bytes.iter().take_while(|b| **b == 0).count();
	let bytes = &bytes[non_zero..];
	if bytes.is_empty() {
		serializer.serialize_str("0x0")
	} else {
		serializer.serialize_str(to_hex_raw(slice, bytes, true))
	}
}
/// Serialize a slice of bytes as uint.
///
/// The representation will have all leading zeros trimmed.
Serialize a slice of bytes as uint.
The representation will have all leading zeros trimmed.
Serialize a slice of bytes as uint . The representation will have all leading zeros trimmed .
pub fn serialize_uint<S>(slice: &mut [u8], bytes: &[u8], serializer: S) -> Result<S::Ok, S::Error>
where
	S: Serializer,
{
	let non_zero = bytes.iter().take_while(|b| **b == 0).count();
	let bytes = &bytes[non_zero..];
	if bytes.is_empty() {
		serializer.serialize_str("0x0")
	} else {
		serializer.serialize_str(to_hex_raw(slice, bytes, true))
	}
}
pub fn serialize_uint < S > ( slice : & mut [ u8 ] , bytes : & [ u8 ] , serializer : S ) -> Result < S :: Ok , S :: Error > where S : Serializer , { let non_zero = bytes . iter ( ) . take_while ( | b | * * b == 0 ) . count ( ) ; let bytes = & bytes [ non_zero .. ] ; if bytes . is_empty ( ) { serializer . serialize_str ( " " ) } else { serializer . serialize_str ( to_hex_raw ( slice , bytes , true ) ) } }
Serialize a slice of bytes as uint.
Serialize a slice of bytes as uint .
slice
&mut [u8]
bytes
&[u8]
serializer
S
slice
&mut [u8]
bytes
&[u8]
serializer
S