File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -381,13 +381,17 @@ impl PyMultiHostUrl {
381
381
// build multi-host url
382
382
for single_host in hosts. as_deref ( ) . unwrap_or_default ( ) {
383
383
let mut multi_url = format ! ( "{scheme}://" ) ;
384
- if single_host. username . is_some ( )
385
- && single_host. host . is_some ( )
386
- && single_host. password . is_some ( )
387
- && single_host. port . is_some ( )
384
+ if single_host. username . is_some ( ) && single_host. password . is_none ( )
388
385
{
389
- todo ! ( )
386
+ multi_url. push_str ( * single_host. username ) ;
387
+ multi_url. push ( '@' ) ;
390
388
}
389
+ else if single_host. username . is_none ( ) && single_host. password . is_some ( )
390
+ {
391
+ multi_url. push_str ( * single_host. password ) ;
392
+ multi_url. push ( '@' ) ;
393
+ } ;
394
+ if single_host. host
391
395
else {
392
396
return Err ( PyValueError :: new_err ( "Incomplete object." ) ) ;
393
397
} ;
You can’t perform that action at this time.
0 commit comments