Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(email): Change as_ref() to as_str() to fix nightly bug #340

Closed
wants to merge 1 commit into from

Conversation

bcmyers
Copy link

@bcmyers bcmyers commented May 18, 2019

If you try to build lettre with the latest nightly (2019-05-18), you get the error illustrated below. This is probably not a bug in lettre but rather a bug in the latest Rust nightly. That said, changing all the as_ref calls to as_str calls in lettre_email/src/lib.rs (as this PR does) fixes the issue without really changing the intent of the lettre code.

Not sure this is worth incorporating, as, again, I suspect the problem is really with Rust nightly, not lettre. That being said, this little fix (changing to as_str) ensures lettre continues to work on nighty as of right now.

error[E0283]: type annotations required: cannot resolve `std::string::String: std::convert::AsRef<_>`
   --> lettre_email/src/lib.rs:130:66
    |
130 |         self.header(("Content-Type", format!("{}", content_type).as_ref()))
    |                                                                  ^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
error: Could not compile `lettre_email`.

To learn more, run the command again with --verbose.

@amousset amousset closed this in 0ead3cd May 18, 2019
@amousset
Copy link
Member

Fixed by removing completely the call to as_ref, thanks for reporting!

@amousset
Copy link
Member

Fixed in 0.9.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants