Skip to content

Added convenience impl IntoConnectParams for String #206

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

Merged
merged 1 commit into from
Oct 11, 2016
Merged

Added convenience impl IntoConnectParams for String #206

merged 1 commit into from
Oct 11, 2016

Conversation

ambiso
Copy link

@ambiso ambiso commented Oct 11, 2016

Currently one must convert Strings to &str using .as_str() in order to invoke Connection::connect.
This may be avoided if Strings refer to the implementation of &str for IntoConnectParams

Here's an example before and after this change.

Before:

let conn = Connection::connect(env::var("DATABASE_URL").unwrap().as_str(), 
                               TlsMode::None)

After:

let conn = Connection::connect(env::var("DATABASE_URL").unwrap(), TlsMode::None)

@sfackler
Copy link
Owner

Seems reasonable, thanks!

@sfackler sfackler merged commit 536f5a3 into sfackler:master Oct 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants