pub fn match_headers(expected: Option<HashMap<String, Vec<String>>>,
  actual: Option<HashMap<String, Vec<String>>>, mismatches: &mut Vec<Mismatch>,
  matchers: &MatchingRules) {
  match (actual, expected) {
    (Some(aqm), Some(eqm)) => match_header_maps(eqm, aqm, mismatches, matchers),
    (Some(_), None) => (),
    (None, Some(eqm)) => for (key, value) in &eqm {
      mismatches.push(Mismatch::HeaderMismatch { key: key.clone(),
        expected: format!("{:?}", value.join(", ")),
        actual: "".to_string(),
        mismatch: format!("Expected header '{}' but was missing", key) });
    },
    (None, None) => (),
  };
}
/// Matches the actual headers to the expected ones.
Matches the actual headers to the expected ones.
Matches the actual headers to the expected ones .
pub fn match_headers(expected: Option<HashMap<String, Vec<String>>>,
  actual: Option<HashMap<String, Vec<String>>>, mismatches: &mut Vec<Mismatch>,
  matchers: &MatchingRules) {
  match (actual, expected) {
    (Some(aqm), Some(eqm)) => match_header_maps(eqm, aqm, mismatches, matchers),
    (Some(_), None) => (),
    (None, Some(eqm)) => for (key, value) in &eqm {
      mismatches.push(Mismatch::HeaderMismatch { key: key.clone(),
        expected: format!("{:?}", value.join(", ")),
        actual: "".to_string(),
        mismatch: format!("Expected header '{}' but was missing", key) });
    },
    (None, None) => (),
  };
}
pub fn match_headers ( expected : Option < HashMap < String , Vec < String > > > , actual : Option < HashMap < String , Vec < String > > > , mismatches : & mut Vec < Mismatch > , matchers : & MatchingRules ) { match ( actual , expected ) { ( Some ( aqm ) , Some ( eqm ) ) => match_header_maps ( eqm , aqm , mismatches , matchers ) , ( Some ( _ ) , None ) => ( ) , ( None , Some ( eqm ) ) => for ( key , value ) in & eqm { mismatches . push ( Mismatch :: HeaderMismatch { key : key . clone ( ) , expected : format ! ( " " value join ( " " ) ) , actual : " " . to_string ( ) , mismatch : format ! ( " " key ) } ) ; } , ( None , None ) => ( ) , } ; }
Matches the actual headers to the expected ones.
Matches the actual headers to the expected ones .
expected
Option<HashMap<String, Vec<String>>>
actual
Option<HashMap<String, Vec<String>>>
mismatches
&mut Vec<Mismatch>
matchers
&MatchingRules
expected
Option<HashMap<String, Vec<String>>>
actual
Option<HashMap<String, Vec<String>>>
mismatches
&mut Vec<Mismatch>
matchers
&MatchingRules