mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
Use itertools
This commit is contained in:
parent
41d73d1312
commit
4d4b91117a
3 changed files with 5 additions and 3 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1229,6 +1229,7 @@ dependencies = [
|
||||||
"base_db",
|
"base_db",
|
||||||
"cargo_metadata",
|
"cargo_metadata",
|
||||||
"cfg",
|
"cfg",
|
||||||
|
"itertools",
|
||||||
"log",
|
"log",
|
||||||
"paths",
|
"paths",
|
||||||
"proc_macro_api",
|
"proc_macro_api",
|
||||||
|
|
|
@ -16,6 +16,7 @@ cargo_metadata = "=0.12.0"
|
||||||
serde = { version = "1.0.106", features = ["derive"] }
|
serde = { version = "1.0.106", features = ["derive"] }
|
||||||
serde_json = "1.0.48"
|
serde_json = "1.0.48"
|
||||||
anyhow = "1.0.26"
|
anyhow = "1.0.26"
|
||||||
|
itertools = "0.9.0"
|
||||||
|
|
||||||
arena = { path = "../arena", version = "0.0.0" }
|
arena = { path = "../arena", version = "0.0.0" }
|
||||||
cfg = { path = "../cfg", version = "0.0.0" }
|
cfg = { path = "../cfg", version = "0.0.0" }
|
||||||
|
|
|
@ -11,6 +11,7 @@ use anyhow::{Context, Result};
|
||||||
use arena::{Arena, Idx};
|
use arena::{Arena, Idx};
|
||||||
use base_db::Edition;
|
use base_db::Edition;
|
||||||
use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId};
|
use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId};
|
||||||
|
use itertools::Itertools;
|
||||||
use paths::{AbsPath, AbsPathBuf};
|
use paths::{AbsPath, AbsPathBuf};
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
|
|
||||||
|
@ -407,9 +408,8 @@ fn inject_cargo_env(package: &cargo_metadata::Package, env: &mut Vec<(String, St
|
||||||
env.push(("CARGO_PKG_VERSION_MINOR".into(), package.version.minor.to_string()));
|
env.push(("CARGO_PKG_VERSION_MINOR".into(), package.version.minor.to_string()));
|
||||||
env.push(("CARGO_PKG_VERSION_PATCH".into(), package.version.patch.to_string()));
|
env.push(("CARGO_PKG_VERSION_PATCH".into(), package.version.patch.to_string()));
|
||||||
|
|
||||||
let pre = package.version.pre.iter().map(|id| id.to_string()).collect::<Vec<_>>();
|
let pre = package.version.pre.iter().map(|id| id.to_string()).format(".");
|
||||||
let pre = pre.join(".");
|
env.push(("CARGO_PKG_VERSION_PRE".into(), pre.to_string()));
|
||||||
env.push(("CARGO_PKG_VERSION_PRE".into(), pre));
|
|
||||||
|
|
||||||
let authors = package.authors.join(";");
|
let authors = package.authors.join(";");
|
||||||
env.push(("CARGO_PKG_AUTHORS".into(), authors));
|
env.push(("CARGO_PKG_AUTHORS".into(), authors));
|
||||||
|
|
Loading…
Reference in a new issue