mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +00:00
Migrate to iters some more
This commit is contained in:
parent
987fb26a5b
commit
a90401aeed
1 changed files with 11 additions and 18 deletions
|
@ -152,24 +152,17 @@ impl ProjectWorkspace {
|
||||||
|
|
||||||
pub fn proc_macro_dylib_paths(&self) -> Vec<PathBuf> {
|
pub fn proc_macro_dylib_paths(&self) -> Vec<PathBuf> {
|
||||||
match self {
|
match self {
|
||||||
ProjectWorkspace::Json { project } => {
|
ProjectWorkspace::Json { project } => project
|
||||||
let mut proc_macro_dylib_paths = Vec::with_capacity(project.crates.len());
|
.crates
|
||||||
for krate in &project.crates {
|
.iter()
|
||||||
if let Some(out_dir) = &krate.proc_macro_dylib_path {
|
.filter_map(|krate| krate.proc_macro_dylib_path.as_ref())
|
||||||
proc_macro_dylib_paths.push(out_dir.to_path_buf());
|
.cloned()
|
||||||
}
|
.collect(),
|
||||||
}
|
ProjectWorkspace::Cargo { cargo, sysroot: _sysroot } => cargo
|
||||||
proc_macro_dylib_paths
|
.packages()
|
||||||
}
|
.filter_map(|pkg| cargo[pkg].proc_macro_dylib_path.as_ref())
|
||||||
ProjectWorkspace::Cargo { cargo, sysroot: _sysroot } => {
|
.cloned()
|
||||||
let mut proc_macro_dylib_paths = Vec::with_capacity(cargo.packages().len());
|
.collect(),
|
||||||
for pkg in cargo.packages() {
|
|
||||||
if let Some(dylib_path) = &cargo[pkg].proc_macro_dylib_path {
|
|
||||||
proc_macro_dylib_paths.push(dylib_path.to_path_buf());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
proc_macro_dylib_paths
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue