Răsfoiți Sursa

fix: Remove conflicting rustfmt config for cli (#1135)

Marc Espín 2 ani în urmă
părinte
comite
20c088b990
2 a modificat fișierele cu 13 adăugiri și 19 ștergeri
  1. 0 8
      packages/cli/rustfmt.toml
  2. 13 11
      packages/cli/src/config.rs

+ 0 - 8
packages/cli/rustfmt.toml

@@ -1,8 +0,0 @@
-version = "Two"
-edition = "2021"
-
-imports_granularity = "Crate"
-#use_small_heuristics = "Max"
-#control_brace_style = "ClosingNextLine"
-normalize_comments = true
-format_code_in_doc_comments = true

+ 13 - 11
packages/cli/src/config.rs

@@ -188,17 +188,19 @@ impl CrateConfig {
 
         let output_filename = {
             match &manifest.package.as_ref().unwrap().default_run {
-                Some(default_run_target) => {
-                    default_run_target.to_owned()
-                },
-                None => {
-                    manifest.bin.iter().find(|b| b.name == manifest.package.as_ref().map(|pkg| pkg.name.clone()))
-                        .or(manifest.bin.iter().find(|b| b.path == Some("src/main.rs".to_owned())))
-                        .or(manifest.bin.first())
-                        .or(manifest.lib.as_ref())
-                        .and_then(|prod| prod.name.clone())
-                        .expect("No executable or library found from cargo metadata.")
-                }
+                Some(default_run_target) => default_run_target.to_owned(),
+                None => manifest
+                    .bin
+                    .iter()
+                    .find(|b| b.name == manifest.package.as_ref().map(|pkg| pkg.name.clone()))
+                    .or(manifest
+                        .bin
+                        .iter()
+                        .find(|b| b.path == Some("src/main.rs".to_owned())))
+                    .or(manifest.bin.first())
+                    .or(manifest.lib.as_ref())
+                    .and_then(|prod| prod.name.clone())
+                    .expect("No executable or library found from cargo metadata."),
             }
         };
         let executable = ExecutableType::Binary(output_filename);