mirror of
https://github.com/sharkdp/bat
synced 2024-11-22 20:03:06 +00:00
Immutably construct variables map
This commit is contained in:
parent
6d0ef259f6
commit
2710a19ecb
1 changed files with 8 additions and 5 deletions
13
build.rs
13
build.rs
|
@ -18,11 +18,14 @@ fn gen_man_and_comp() -> anyhow::Result<()> {
|
|||
let executable_name_uppercase = executable_name.to_uppercase();
|
||||
let project_version = env::var("CARGO_PKG_VERSION")?;
|
||||
|
||||
let mut variables = HashMap::new();
|
||||
variables.insert("PROJECT_NAME", project_name);
|
||||
variables.insert("PROJECT_EXECUTABLE", executable_name);
|
||||
variables.insert("PROJECT_EXECUTABLE_UPPERCASE", executable_name_uppercase);
|
||||
variables.insert("PROJECT_VERSION", project_version);
|
||||
let variables = [
|
||||
("PROJECT_NAME", project_name),
|
||||
("PROJECT_EXECUTABLE", executable_name),
|
||||
("PROJECT_EXECUTABLE_UPPERCASE", executable_name_uppercase),
|
||||
("PROJECT_VERSION", project_version),
|
||||
]
|
||||
.into_iter()
|
||||
.collect();
|
||||
|
||||
let Some(out_dir) = env::var_os("BAT_ASSETS_GEN_DIR")
|
||||
.or_else(|| env::var_os("OUT_DIR"))
|
||||
|
|
Loading…
Reference in a new issue