File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -248,6 +248,16 @@ impl IntoConnectParams for PostgresConnectParams {
248248}
249249
250250impl < ' a > IntoConnectParams for & ' a str {
251+ fn into_connect_params ( self ) -> Result < PostgresConnectParams ,
252+ PostgresConnectError > {
253+ match url:: from_str ( self ) {
254+ Ok ( url) => url. into_connect_params ( ) ,
255+ Err ( err) => return Err ( InvalidUrl ( err) ) ,
256+ }
257+ }
258+ }
259+
260+ impl IntoConnectParams for Url {
251261 fn into_connect_params ( self ) -> Result < PostgresConnectParams ,
252262 PostgresConnectError > {
253263 let Url {
@@ -257,10 +267,7 @@ impl<'a> IntoConnectParams for &'a str {
257267 path,
258268 query : options,
259269 ..
260- } = match url:: from_str ( self ) {
261- Ok ( url) => url,
262- Err ( err) => return Err ( InvalidUrl ( err) )
263- } ;
270+ } = self ;
264271
265272 let maybe_path = url:: decode_component ( host. as_slice ( ) ) ;
266273 let target = if maybe_path. as_slice ( ) . starts_with ( "/" ) {
You can’t perform that action at this time.
0 commit comments