rust-email icon indicating copy to clipboard operation
rust-email copied to clipboard

Change Rc → Arc

Open golddranks opened this issue 9 years ago • 6 comments

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 avatar Feb 15 '17 17:02 golddranks

Do you accept pull requests?

golddranks avatar Feb 15 '17 17:02 golddranks

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

niax avatar Feb 15 '17 17:02 niax

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

golddranks avatar Feb 15 '17 17:02 golddranks

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

golddranks avatar Feb 15 '17 17:02 golddranks

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.

niax avatar Feb 15 '17 18:02 niax

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

golddranks avatar Feb 15 '17 18:02 golddranks