Skip to content

Commit a5d16df

Browse files
calebcartwrighttopecongiro
authored andcommitted
feat: use offline by default with cargo fmt (#3830)
1 parent 0497a7d commit a5d16df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cargo-fmt/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,12 @@ fn get_cargo_metadata(
519519
if let Some(manifest_path) = manifest_path {
520520
cmd.manifest_path(manifest_path);
521521
}
522+
cmd.other_options(&[String::from("--offline")]);
522523

523524
match cmd.exec() {
524525
Ok(metadata) => Ok(metadata),
525526
Err(_) => {
526-
cmd.other_options(&[String::from("--offline")]);
527+
cmd.other_options(vec![]);
527528
match cmd.exec() {
528529
Ok(metadata) => Ok(metadata),
529530
Err(error) => Err(io::Error::new(io::ErrorKind::Other, error.to_string())),

0 commit comments

Comments
 (0)