/// Concatenates two MAC addresses in canonical order (largest one first)
Concatenates two MAC addresses in canonical order (largest one first)
Concatenates two MAC addresses in canonical order ( largest one first )
fn concat_mac_addrs(sta_a_mac: &MacAddr, sta_b_mac: &MacAddr) -> Vec<u8> {
    let mut result: Vec<u8> = Vec::with_capacity(sta_a_mac.len() + sta_b_mac.len());
    match sta_a_mac.cmp(sta_b_mac) {
        std::cmp::Ordering::Less => {
            result.extend_from_slice(sta_b_mac);
            result.extend_from_slice(sta_a_mac);
        }
        _ => {
            result.extend_from_slice(sta_a_mac);
            result.extend_from_slice(sta_b_mac);
        }
    };
    result
}
fn concat_mac_addrs ( sta_a_mac : & MacAddr , sta_b_mac : & MacAddr ) -> Vec < u8 > { let mut result : Vec < u8 > = Vec :: with_capacity ( sta_a_mac . len ( ) + sta_b_mac . len ( ) ) ; match sta_a_mac . cmp ( sta_b_mac ) { std :: cmp :: Ordering :: Less => { result . extend_from_slice ( sta_b_mac ) ; result . extend_from_slice ( sta_a_mac ) ; } _ => { result . extend_from_slice ( sta_a_mac ) ; result . extend_from_slice ( sta_b_mac ) ; } } ; result }
Concatenates two MAC addresses in canonical order (largest one first)
Concatenates two MAC addresses in canonical order ( largest one first )
sta_a_mac
&MacAddr
sta_b_mac
&MacAddr