Răsfoiți Sursa

xtask: destructure

Tamir Duberstein 1 an în urmă
părinte
comite
ecc03ecfad
1 a modificat fișierele cu 7 adăugiri și 8 ștergeri
  1. 7 8
      xtask/src/main.rs

+ 7 - 8
xtask/src/main.rs

@@ -24,15 +24,14 @@ enum Command {
 }
 
 fn main() {
-    let opts = XtaskOptions::parse();
+    let XtaskOptions { command } = Parser::parse();
 
-    use Command::*;
-    let ret = match opts.command {
-        Codegen(opts) => codegen::codegen(opts),
-        Docs => docs::docs(),
-        BuildIntegrationTest(opts) => build_test::build_test(opts),
-        BuildIntegrationTestEbpf(opts) => build_ebpf::build_ebpf(opts),
-        IntegrationTest(opts) => run::run(opts),
+    let ret = match command {
+        Command::Codegen(opts) => codegen::codegen(opts),
+        Command::Docs => docs::docs(),
+        Command::BuildIntegrationTest(opts) => build_test::build_test(opts),
+        Command::BuildIntegrationTestEbpf(opts) => build_ebpf::build_ebpf(opts),
+        Command::IntegrationTest(opts) => run::run(opts),
     };
 
     if let Err(e) = ret {