Skip to content

Commit

Permalink
feat: use offline by default with cargo fmt (rust-lang#3830)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright authored and topecongiro committed Oct 19, 2019
1 parent 0497a7d commit a5d16df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cargo-fmt/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,12 @@ fn get_cargo_metadata(
if let Some(manifest_path) = manifest_path {
cmd.manifest_path(manifest_path);
}
cmd.other_options(&[String::from("--offline")]);

match cmd.exec() {
Ok(metadata) => Ok(metadata),
Err(_) => {
cmd.other_options(&[String::from("--offline")]);
cmd.other_options(vec![]);
match cmd.exec() {
Ok(metadata) => Ok(metadata),
Err(error) => Err(io::Error::new(io::ErrorKind::Other, error.to_string())),
Expand Down

0 comments on commit a5d16df

Please sign in to comment.