diff options
Diffstat (limited to 'xtask/src/install.rs')
-rw-r--r-- | xtask/src/install.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/xtask/src/install.rs b/xtask/src/install.rs index 9ba77a3aa..a0dc0c9c2 100644 --- a/xtask/src/install.rs +++ b/xtask/src/install.rs | |||
@@ -19,7 +19,13 @@ pub enum ClientOpt { | |||
19 | } | 19 | } |
20 | 20 | ||
21 | pub struct ServerOpt { | 21 | pub struct ServerOpt { |
22 | pub jemalloc: bool, | 22 | pub malloc: Malloc, |
23 | } | ||
24 | |||
25 | pub enum Malloc { | ||
26 | System, | ||
27 | Jemalloc, | ||
28 | Mimalloc, | ||
23 | } | 29 | } |
24 | 30 | ||
25 | impl InstallCmd { | 31 | impl InstallCmd { |
@@ -130,8 +136,12 @@ fn install_server(opts: ServerOpt) -> Result<()> { | |||
130 | ) | 136 | ) |
131 | } | 137 | } |
132 | 138 | ||
133 | let jemalloc = if opts.jemalloc { "--features jemalloc" } else { "" }; | 139 | let malloc_feature = match opts.malloc { |
134 | let res = run!("cargo install --path crates/rust-analyzer --locked --force {}", jemalloc); | 140 | Malloc::System => "", |
141 | Malloc::Jemalloc => "--features jemalloc", | ||
142 | Malloc::Mimalloc => "--features mimalloc", | ||
143 | }; | ||
144 | let res = run!("cargo install --path crates/rust-analyzer --locked --force {}", malloc_feature); | ||
135 | 145 | ||
136 | if res.is_err() && old_rust { | 146 | if res.is_err() && old_rust { |
137 | eprintln!( | 147 | eprintln!( |