Add convenience impl IntoConnectParams for String

This commit is contained in:
p512 2016-10-11 21:32:51 +02:00
parent 333b62a8c2
commit 839b4914db

View File

@ -66,6 +66,12 @@ impl<'a> IntoConnectParams for &'a str {
} }
} }
impl IntoConnectParams for String {
fn into_connect_params(self) -> Result<ConnectParams, Box<Error + Sync + Send>> {
self.as_str().into_connect_params()
}
}
impl IntoConnectParams for Url { impl IntoConnectParams for Url {
fn into_connect_params(self) -> Result<ConnectParams, Box<Error + Sync + Send>> { fn into_connect_params(self) -> Result<ConnectParams, Box<Error + Sync + Send>> {
let Url { host, port, user, path: url::Path { mut path, query: options, .. }, .. } = self; let Url { host, port, user, path: url::Path { mut path, query: options, .. }, .. } = self;