@@ -258,15 +258,23 @@ fn parse_message_headers(headers: &[Value]) -> ParsedMessageHeaders {
258258 let name = header. get ( "name" ) . and_then ( |v| v. as_str ( ) ) . unwrap_or ( "" ) ;
259259 let value = header. get ( "value" ) . and_then ( |v| v. as_str ( ) ) . unwrap_or ( "" ) ;
260260
261- match name. to_ascii_lowercase ( ) . as_str ( ) {
262- "from" => parsed. from = value. to_string ( ) ,
263- "reply-to" => append_address_list_header_value ( & mut parsed. reply_to , value) ,
264- "to" => append_address_list_header_value ( & mut parsed. to , value) ,
265- "cc" => append_address_list_header_value ( & mut parsed. cc , value) ,
266- "subject" => parsed. subject = value. to_string ( ) ,
267- "date" => parsed. date = value. to_string ( ) ,
268- "message-id" => parsed. message_id = value. to_string ( ) ,
269- "references" => append_header_value ( & mut parsed. references , value) ,
261+ match name {
262+ s if s. eq_ignore_ascii_case ( "from" ) => parsed. from = value. to_string ( ) ,
263+ s if s. eq_ignore_ascii_case ( "reply-to" ) => {
264+ append_address_list_header_value ( & mut parsed. reply_to , value)
265+ }
266+ s if s. eq_ignore_ascii_case ( "to" ) => {
267+ append_address_list_header_value ( & mut parsed. to , value)
268+ }
269+ s if s. eq_ignore_ascii_case ( "cc" ) => {
270+ append_address_list_header_value ( & mut parsed. cc , value)
271+ }
272+ s if s. eq_ignore_ascii_case ( "subject" ) => parsed. subject = value. to_string ( ) ,
273+ s if s. eq_ignore_ascii_case ( "date" ) => parsed. date = value. to_string ( ) ,
274+ s if s. eq_ignore_ascii_case ( "message-id" ) => parsed. message_id = value. to_string ( ) ,
275+ s if s. eq_ignore_ascii_case ( "references" ) => {
276+ append_header_value ( & mut parsed. references , value)
277+ }
270278 _ => { }
271279 }
272280 }
0 commit comments