niax / rust-email

Implementation of MIME Messages for Rust
MIT License
62 stars 34 forks source link

Change Rc → Arc #37

Open golddranks opened 7 years ago

golddranks commented 7 years ago

Rc prevents the datatypes defined in this crate from being Send. This affects some downstream crates that use the data types in this crate for implementing email-related stuff. Sometimes these things need to be send between threads (for example, when you have one mailer thread and you prepare emails in many threads and send them to the mailer thread), so this hinders the usability of the types defined here.

golddranks commented 7 years ago

Do you accept pull requests?

niax commented 7 years ago

I don't have much time to work on this, but I do accept pull requests.

golddranks commented 7 years ago

There ya go! https://github.com/niax/rust-email/pull/38

golddranks commented 7 years ago

Btw. is Rc a public type in the APIs of this crate? I couldn't find anything exposed after checking the docs a bit.

niax commented 7 years ago

Rc is only used to maintain two references to a Header within the HeaderMap such that we can keep the ordering of headers in one structure, and index the headers by name in a different one.

golddranks commented 7 years ago

Okay, in that case this isn't a breaking change, since it makes the types strictly more flexible.