-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
rustfmt use cargo-metadata
to get all kinds of metadata, but default use online
mode and can not change to offline
.
But it is well known that because of various network problems, cargo
added the --offline
option, metadata
also supports this option, but fmt
does not support.
I strongly recommend that fmt
also have the offline parameter or default with offline
.
Lines 511 to 526 in ee38d02
fn get_cargo_metadata( | |
manifest_path: Option<&Path>, | |
include_deps: bool, | |
) -> Result<cargo_metadata::Metadata, io::Error> { | |
let mut cmd = cargo_metadata::MetadataCommand::new(); | |
if !include_deps { | |
cmd.no_deps(); | |
} | |
if let Some(manifest_path) = manifest_path { | |
cmd.manifest_path(manifest_path); | |
} | |
match cmd.exec() { | |
Ok(metadata) => Ok(metadata), | |
Err(error) => Err(io::Error::new(io::ErrorKind::Other, error.to_string())), | |
} | |
} |
deepseeksss, zhangsoledad, u2 and DCjanus
Metadata
Metadata
Assignees
Labels
No labels