Home Explore Blog CI



70e936f76330816a7562502fea04172ef95d858738d89594000000020002d8a0.png

Extracted Text
← rust-analyzer Unshare README.md main.rs → xtask/src/main.rs 34 match flags.subcommand { 35 flags::XtaskCmd:: Install (cmd) => cmd.run(sh), 36 flags:: XtaskCmd:: FuzzTests(-) → run_fuzzer (sh), 37 flags:: XtaskCmd:: Release (cmd) => cmd.run(sh), 38 flags:: XtaskCmd:: Promote (cmd) => cmd.run(sh), 39 flags::XtaskCmd:: Dist(cmd) => cmd.run(sh), 40 flags:: XtaskCmd:: PublishRelease Notes (cmd) cmd.run(sh), 41 flags:: XtaskCmd:: Metrics(cmd) cmd.run(sh), 42 flags::XtaskCmd::Bb(cmd) => { 43 { 44 let_d = sh.push_dir("./crates/rust-analyzer"); 45 cmd! (sh, "cargo build --release--features jemalloc").run()?; 46 } 47 sh.copy_file( 48 "./target/release/rust-analyzer", 49 format!("./target/rust-analyzer-{}", cmd.suffix), 50 )?; 51 Ok(()) 52 } 53 } 54 } 55 1,1 Rust1 + Π
Explanation
This image shows a code snippet in the Rust programming language, specifically from the 'main.rs' file within an 'xtask' directory. The code appears to be defining a command-line interface using a 'match' statement on a subcommand called 'flags.subcommand'. Each subcommand has an associated action, which involves running shell commands using 'cmd.run(sh)' and possibly other functions like 'run_fuzzer(sh)'. One of the subcommands is 'Bb', which seems to be building and copying a 'rust-analyzer' binary with specific features.