diff options
author | Jonas Schievink <[email protected]> | 2020-12-10 18:29:11 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-12-10 18:29:11 +0000 |
commit | 4d4b91117a02b55e913216459ae661d8dd166579 (patch) | |
tree | 30e840e17725f3cb6f2d5c223ba6b05acffabbf4 | |
parent | 41d73d131266c864495ce592749b74f580b17b23 (diff) |
Use itertools
-rw-r--r-- | Cargo.lock | 1 | ||||
-rw-r--r-- | crates/project_model/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/project_model/src/cargo_workspace.rs | 6 |
3 files changed, 5 insertions, 3 deletions
diff --git a/Cargo.lock b/Cargo.lock index c6994127b..d3aec4c99 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -1229,6 +1229,7 @@ dependencies = [ | |||
1229 | "base_db", | 1229 | "base_db", |
1230 | "cargo_metadata", | 1230 | "cargo_metadata", |
1231 | "cfg", | 1231 | "cfg", |
1232 | "itertools", | ||
1232 | "log", | 1233 | "log", |
1233 | "paths", | 1234 | "paths", |
1234 | "proc_macro_api", | 1235 | "proc_macro_api", |
diff --git a/crates/project_model/Cargo.toml b/crates/project_model/Cargo.toml index e0c591603..c55e85709 100644 --- a/crates/project_model/Cargo.toml +++ b/crates/project_model/Cargo.toml | |||
@@ -16,6 +16,7 @@ cargo_metadata = "=0.12.0" | |||
16 | serde = { version = "1.0.106", features = ["derive"] } | 16 | serde = { version = "1.0.106", features = ["derive"] } |
17 | serde_json = "1.0.48" | 17 | serde_json = "1.0.48" |
18 | anyhow = "1.0.26" | 18 | anyhow = "1.0.26" |
19 | itertools = "0.9.0" | ||
19 | 20 | ||
20 | arena = { path = "../arena", version = "0.0.0" } | 21 | arena = { path = "../arena", version = "0.0.0" } |
21 | cfg = { path = "../cfg", version = "0.0.0" } | 22 | cfg = { path = "../cfg", version = "0.0.0" } |
diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs index 4c1ba5e75..894c5c952 100644 --- a/crates/project_model/src/cargo_workspace.rs +++ b/crates/project_model/src/cargo_workspace.rs | |||
@@ -11,6 +11,7 @@ use anyhow::{Context, Result}; | |||
11 | use arena::{Arena, Idx}; | 11 | use arena::{Arena, Idx}; |
12 | use base_db::Edition; | 12 | use base_db::Edition; |
13 | use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId}; | 13 | use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId}; |
14 | use itertools::Itertools; | ||
14 | use paths::{AbsPath, AbsPathBuf}; | 15 | use paths::{AbsPath, AbsPathBuf}; |
15 | use rustc_hash::FxHashMap; | 16 | use rustc_hash::FxHashMap; |
16 | 17 | ||
@@ -407,9 +408,8 @@ fn inject_cargo_env(package: &cargo_metadata::Package, env: &mut Vec<(String, St | |||
407 | env.push(("CARGO_PKG_VERSION_MINOR".into(), package.version.minor.to_string())); | 408 | env.push(("CARGO_PKG_VERSION_MINOR".into(), package.version.minor.to_string())); |
408 | env.push(("CARGO_PKG_VERSION_PATCH".into(), package.version.patch.to_string())); | 409 | env.push(("CARGO_PKG_VERSION_PATCH".into(), package.version.patch.to_string())); |
409 | 410 | ||
410 | let pre = package.version.pre.iter().map(|id| id.to_string()).collect::<Vec<_>>(); | 411 | let pre = package.version.pre.iter().map(|id| id.to_string()).format("."); |
411 | let pre = pre.join("."); | 412 | env.push(("CARGO_PKG_VERSION_PRE".into(), pre.to_string())); |
412 | env.push(("CARGO_PKG_VERSION_PRE".into(), pre)); | ||
413 | 413 | ||
414 | let authors = package.authors.join(";"); | 414 | let authors = package.authors.join(";"); |
415 | env.push(("CARGO_PKG_AUTHORS".into(), authors)); | 415 | env.push(("CARGO_PKG_AUTHORS".into(), authors)); |