Skip to content

Commit 1a62b6d

Browse files
committed
refactor: rename MimeMessage.header into MimeMessage.headers
1 parent 915008d commit 1a62b6d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/mimeparser.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub(crate) struct MimeMessage {
5252
pub parts: Vec<Part>,
5353

5454
/// Message headers.
55-
header: HashMap<String, String>,
55+
headers: HashMap<String, String>,
5656

5757
/// Addresses are normalized and lowercased:
5858
pub recipients: Vec<SingleInfo>,
@@ -386,7 +386,7 @@ impl MimeMessage {
386386

387387
let mut parser = MimeMessage {
388388
parts: Vec::new(),
389-
header: headers,
389+
headers,
390390
recipients,
391391
list_post,
392392
from,
@@ -692,7 +692,7 @@ impl MimeMessage {
692692
self.parts.push(part);
693693
}
694694

695-
if self.header.contains_key("auto-submitted") {
695+
if self.headers.contains_key("auto-submitted") {
696696
for part in &mut self.parts {
697697
part.param.set(Param::Bot, "1");
698698
}
@@ -773,11 +773,11 @@ impl MimeMessage {
773773
/// Returns whether the email contains a `chat-version` header.
774774
/// This indicates that the email is a DC-email.
775775
pub(crate) fn has_chat_version(&self) -> bool {
776-
self.header.contains_key("chat-version")
776+
self.headers.contains_key("chat-version")
777777
}
778778

779779
pub(crate) fn has_headers(&self) -> bool {
780-
!self.header.is_empty()
780+
!self.headers.is_empty()
781781
}
782782

783783
pub(crate) fn get_subject(&self) -> Option<String> {
@@ -787,7 +787,7 @@ impl MimeMessage {
787787
}
788788

789789
pub fn get_header(&self, headerdef: HeaderDef) -> Option<&String> {
790-
self.header.get(headerdef.get_headername())
790+
self.headers.get(headerdef.get_headername())
791791
}
792792

793793
fn parse_mime_recursive<'a>(

0 commit comments

Comments
 (0)