Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
alsuren committed Dec 23, 2020
1 parent 26b088e commit da74ad3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,23 +240,18 @@ fn build_docker_image(toml: &Toml, target: &Target, verbose: bool) -> Result<Str

pub fn image(toml: Option<&Toml>, target: &Target, verbose: bool) -> Result<String> {
if let Some(toml) = toml {
match (toml.image(target)?.map(|s| s.to_owned()), toml.context(target)?) {
match (toml.image(target)?, toml.context(target)?) {
(Some(_image), Some(_context)) => {
// https://docs.docker.com/compose/compose-file/#build says:
// If you specify image as well as build, then Compose names the
// built image with the webapp and optional tag specified in image.
// This is not supported yet, so the best thing to do is to explode.
bail!("Specifying `image` and `context` in Cross.toml is not yet supported.")
},
(Some(image), None) => return Ok(image),
(Some(image), None) => return Ok(image.to_owned()),
(None, Some(_context)) => return build_docker_image(toml, target, verbose),
(None, None) => (),
}
if let Some(image) = toml.image(target)?.map(|s| s.to_owned()) {
return Ok(image)
} else if let Some(_) = toml.context(target)? {
return build_docker_image(toml, target, verbose)
}
}

let triple = target.triple();
Expand Down

0 comments on commit da74ad3

Please sign in to comment.