wasm_pack/install/tool.rs
1use std::fmt;
2
3/// Represents the set of CLI tools wasm-pack uses
4pub enum Tool {
5 /// cargo-generate CLI tool
6 CargoGenerate,
7 /// wasm-bindgen CLI tools
8 WasmBindgen,
9 /// wasm-opt CLI tool
10 WasmOpt,
11}
12
13impl fmt::Display for Tool {
14 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
15 let s = match self {
16 Tool::CargoGenerate => "cargo-generate",
17 Tool::WasmBindgen => "wasm-bindgen",
18 Tool::WasmOpt => "wasm-opt",
19 };
20 write!(f, "{}", s)
21 }
22}