Function armorlib::util::u8s_to_u16
[−]
[src]
pub fn u8s_to_u16(first: u8, second: u8) -> u16
A utility function that, given two u8s, uses a bit shift operation and a binary OR
operation to return a u16. The first 8 bits of this u16 are those of the argument first,
while the second 8 bits are those of the argument second.
Examples
use armorlib::util; let first = 0x12_u8; let second = 0xAB_u8; assert_eq!(util::u8s_to_u16(first, second), 0x12AB_u16);