Skip to content

Commit

Permalink
Replace deprecated Uri::scheme with Uri::scheme_part
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanmckay committed Aug 7, 2018
1 parent 1b8e837 commit e3c70ca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,19 @@ impl Docker {
pub fn host(host: Uri) -> Docker {
let tcp_host_str = format!(
"{}://{}:{}",
host.scheme().unwrap(),
host.scheme_part().map(|s| s.as_str()).unwrap(),
host.host().unwrap().to_owned(),
host.port().unwrap_or(80));

match host.scheme_part().map(|s| s.as_str()) {
Some("unix") => {
Docker {
transport: Transport::Unix {
client: Client::builder().build(UnixConnector),
path: host.path().to_owned(),
},
}
}
_ => {
if let Some(ref certs) = env::var(
"DOCKER_CERT_PATH",
Expand Down

0 comments on commit e3c70ca

Please sign in to comment.