Fix formatting issues with cargo fmt
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Thu, 29 Mar 2018 17:40:02 +0000 (19:40 +0200)
committerDirkjan Ochtman <dirkjan@ochtman.nl>
Thu, 29 Mar 2018 17:40:02 +0000 (19:40 +0200)
src/cargo/core/manifest.rs
src/cargo/core/resolver/encode.rs
src/cargo/ops/cargo_output_metadata.rs
src/cargo/ops/cargo_rustc/fingerprint.rs
src/cargo/sources/git/utils.rs
src/cargo/sources/registry/mod.rs
src/cargo/sources/replaced.rs
src/cargo/util/toml/mod.rs

index b3ab4265999c9b0f5c58bcceb719b8b175e68fa4..c004089edb2efa3e7c4026b22f6f7b30fca8862d 100644 (file)
@@ -156,20 +156,30 @@ impl ser::Serialize for TargetKind {
 #[derive(Clone, PartialEq, Eq, Debug, Hash, Serialize)]
 pub struct Profile {
     pub opt_level: String,
-    #[serde(skip_serializing)] pub lto: Lto,
-    #[serde(skip_serializing)] pub codegen_units: Option<u32>, // None = use rustc default
-    #[serde(skip_serializing)] pub rustc_args: Option<Vec<String>>,
-    #[serde(skip_serializing)] pub rustdoc_args: Option<Vec<String>>,
+    #[serde(skip_serializing)]
+    pub lto: Lto,
+    #[serde(skip_serializing)]
+    pub codegen_units: Option<u32>, // None = use rustc default
+    #[serde(skip_serializing)]
+    pub rustc_args: Option<Vec<String>>,
+    #[serde(skip_serializing)]
+    pub rustdoc_args: Option<Vec<String>>,
     pub debuginfo: Option<u32>,
     pub debug_assertions: bool,
     pub overflow_checks: bool,
-    #[serde(skip_serializing)] pub rpath: bool,
+    #[serde(skip_serializing)]
+    pub rpath: bool,
     pub test: bool,
-    #[serde(skip_serializing)] pub doc: bool,
-    #[serde(skip_serializing)] pub run_custom_build: bool,
-    #[serde(skip_serializing)] pub check: bool,
-    #[serde(skip_serializing)] pub panic: Option<String>,
-    #[serde(skip_serializing)] pub incremental: bool,
+    #[serde(skip_serializing)]
+    pub doc: bool,
+    #[serde(skip_serializing)]
+    pub run_custom_build: bool,
+    #[serde(skip_serializing)]
+    pub check: bool,
+    #[serde(skip_serializing)]
+    pub panic: Option<String>,
+    #[serde(skip_serializing)]
+    pub incremental: bool,
 }
 
 #[derive(Clone, PartialEq, Eq, Debug, Hash)]
index 3bb318c17ad5dc21b9c595d98205f4573ad6aadb..8425453d3620676c3a59b9b8988be4505a8e4e69 100644 (file)
@@ -18,7 +18,8 @@ pub struct EncodableResolve {
     root: Option<EncodableDependency>,
     metadata: Option<Metadata>,
 
-    #[serde(default, skip_serializing_if = "Patch::is_empty")] patch: Patch,
+    #[serde(default, skip_serializing_if = "Patch::is_empty")]
+    patch: Patch,
 }
 
 #[derive(Serialize, Deserialize, Debug, Default)]
index 96f52d36754843e476c761de499ab1e355a89131..681a3090ae518d96f622e9f9883b6c3ceef090e7 100644 (file)
@@ -89,7 +89,8 @@ pub struct ExportInfo {
 /// format for `PackageId`s
 #[derive(Serialize)]
 struct MetadataResolve {
-    #[serde(rename = "nodes", serialize_with = "serialize_resolve")] resolve: Resolve,
+    #[serde(rename = "nodes", serialize_with = "serialize_resolve")]
+    resolve: Resolve,
     root: Option<PackageId>,
 }
 
index 7b213bc48c938d8b678e8d1f5e187d18e75d1e77..74deda193d8bf9044486f879bd0cd3ac98f9cafd 100644 (file)
@@ -152,7 +152,8 @@ pub struct Fingerprint {
     #[serde(serialize_with = "serialize_deps", deserialize_with = "deserialize_deps")]
     deps: Vec<(String, Arc<Fingerprint>)>,
     local: Vec<LocalFingerprint>,
-    #[serde(skip_serializing, skip_deserializing)] memoized_hash: Mutex<Option<u64>>,
+    #[serde(skip_serializing, skip_deserializing)]
+    memoized_hash: Mutex<Option<u64>>,
     rustflags: Vec<String>,
     epoch: Epoch,
 }
index 2314db18c6c8558efc97ee6c3776f17cde9ba250..5ecb5b1b6e2d17f21b07efc8c38048bb39915c5e 100644 (file)
@@ -50,7 +50,8 @@ impl GitShortID {
 /// `GitDatabase`.
 #[derive(PartialEq, Clone, Debug, Serialize)]
 pub struct GitRemote {
-    #[serde(serialize_with = "serialize_str")] url: Url,
+    #[serde(serialize_with = "serialize_str")]
+    url: Url,
 }
 
 /// `GitDatabase` is a local clone of a remote repository's database. Multiple
@@ -59,7 +60,8 @@ pub struct GitRemote {
 pub struct GitDatabase {
     remote: GitRemote,
     path: PathBuf,
-    #[serde(skip_serializing)] repo: git2::Repository,
+    #[serde(skip_serializing)]
+    repo: git2::Repository,
 }
 
 /// `GitCheckout` is a local checkout of a particular revision. Calling
@@ -70,7 +72,8 @@ pub struct GitCheckout<'a> {
     database: &'a GitDatabase,
     location: PathBuf,
     revision: GitRevision,
-    #[serde(skip_serializing)] repo: git2::Repository,
+    #[serde(skip_serializing)]
+    repo: git2::Repository,
 }
 
 // Implementations
index 3a8183b28a0c45fa8eb9ec61c937fc1d50d077a9..949c44a221db5191d7a946a3fdd58ea8e19af774 100644 (file)
@@ -221,7 +221,8 @@ struct RegistryPackage<'a> {
     features: BTreeMap<String, Vec<String>>,
     cksum: String,
     yanked: Option<bool>,
-    #[serde(default)] links: Option<String>,
+    #[serde(default)]
+    links: Option<String>,
 }
 
 struct DependencyList {
index 647df4c2346d0f9c81fbe1e62e95d15085441b18..3f223ef61627079d67be5e48b9b6ba1db1ed37f9 100644 (file)
@@ -27,9 +27,10 @@ impl<'cfg> Registry for ReplacedSource<'cfg> {
         let dep = dep.clone().map_source(to_replace, replace_with);
 
         self.inner
-            .query(&dep, &mut |summary| {
-                f(summary.map_source(replace_with, to_replace))
-            })
+            .query(
+                &dep,
+                &mut |summary| f(summary.map_source(replace_with, to_replace)),
+            )
             .chain_err(|| format!("failed to query replaced source {}", self.to_replace))?;
         Ok(())
     }
index 092ce8f7f67589a2c89d9877795a0db6696309ae..e0538d221e9b25e591e010edeb80c9925e282f87 100644 (file)
@@ -202,7 +202,8 @@ pub struct DetailedTomlDependency {
     features: Option<Vec<String>>,
     optional: Option<bool>,
     default_features: Option<bool>,
-    #[serde(rename = "default_features")] default_features2: Option<bool>,
+    #[serde(rename = "default_features")]
+    default_features2: Option<bool>,
     package: Option<String>,
 }
 
@@ -347,14 +348,18 @@ impl<'de> de::Deserialize<'de> for U32OrBool {
 
 #[derive(Deserialize, Serialize, Clone, Debug, Default)]
 pub struct TomlProfile {
-    #[serde(rename = "opt-level")] opt_level: Option<TomlOptLevel>,
+    #[serde(rename = "opt-level")]
+    opt_level: Option<TomlOptLevel>,
     lto: Option<StringOrBool>,
-    #[serde(rename = "codegen-units")] codegen_units: Option<u32>,
+    #[serde(rename = "codegen-units")]
+    codegen_units: Option<u32>,
     debug: Option<U32OrBool>,
-    #[serde(rename = "debug-assertions")] debug_assertions: Option<bool>,
+    #[serde(rename = "debug-assertions")]
+    debug_assertions: Option<bool>,
     rpath: Option<bool>,
     panic: Option<String>,
-    #[serde(rename = "overflow-checks")] overflow_checks: Option<bool>,
+    #[serde(rename = "overflow-checks")]
+    overflow_checks: Option<bool>,
     incremental: Option<bool>,
 }
 
@@ -449,9 +454,11 @@ pub struct TomlProject {
     exclude: Option<Vec<String>>,
     include: Option<Vec<String>>,
     publish: Option<VecStringOrBool>,
-    #[serde(rename = "publish-lockfile")] publish_lockfile: Option<bool>,
+    #[serde(rename = "publish-lockfile")]
+    publish_lockfile: Option<bool>,
     workspace: Option<String>,
-    #[serde(rename = "im-a-teapot")] im_a_teapot: Option<bool>,
+    #[serde(rename = "im-a-teapot")]
+    im_a_teapot: Option<bool>,
 
     // package metadata
     description: Option<String>,
@@ -461,7 +468,8 @@ pub struct TomlProject {
     keywords: Option<Vec<String>>,
     categories: Option<Vec<String>>,
     license: Option<String>,
-    #[serde(rename = "license-file")] license_file: Option<String>,
+    #[serde(rename = "license-file")]
+    license_file: Option<String>,
     repository: Option<String>,
     metadata: Option<toml::Value>,
     rust: Option<String>,
@@ -470,7 +478,8 @@ pub struct TomlProject {
 #[derive(Debug, Deserialize, Serialize)]
 pub struct TomlWorkspace {
     members: Option<Vec<String>>,
-    #[serde(rename = "default-members")] default_members: Option<Vec<String>>,
+    #[serde(rename = "default-members")]
+    default_members: Option<Vec<String>>,
     exclude: Option<Vec<String>>,
 }
 
@@ -1176,8 +1185,10 @@ struct TomlTarget {
 
     // The intention was to only accept `crate-type` here but historical
     // versions of Cargo also accepted `crate_type`, so look for both.
-    #[serde(rename = "crate-type")] crate_type: Option<Vec<String>>,
-    #[serde(rename = "crate_type")] crate_type2: Option<Vec<String>>,
+    #[serde(rename = "crate-type")]
+    crate_type: Option<Vec<String>>,
+    #[serde(rename = "crate_type")]
+    crate_type2: Option<Vec<String>>,
 
     path: Option<PathValue>,
     test: Option<bool>,
@@ -1185,10 +1196,13 @@ struct TomlTarget {
     bench: Option<bool>,
     doc: Option<bool>,
     plugin: Option<bool>,
-    #[serde(rename = "proc-macro")] proc_macro: Option<bool>,
-    #[serde(rename = "proc_macro")] proc_macro2: Option<bool>,
+    #[serde(rename = "proc-macro")]
+    proc_macro: Option<bool>,
+    #[serde(rename = "proc_macro")]
+    proc_macro2: Option<bool>,
     harness: Option<bool>,
-    #[serde(rename = "required-features")] required_features: Option<Vec<String>>,
+    #[serde(rename = "required-features")]
+    required_features: Option<Vec<String>>,
 }
 
 #[derive(Clone)]