mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Remove unnecessary CfgFlag definition in project-model
This commit is contained in:
parent
ee10731c31
commit
d2fe906a62
8 changed files with 367 additions and 376 deletions
|
@ -690,6 +690,14 @@ impl Env {
|
|||
pub fn extend_from_other(&mut self, other: &Env) {
|
||||
self.entries.extend(other.entries.iter().map(|(x, y)| (x.to_owned(), y.to_owned())));
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.entries.is_empty()
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, k: impl Into<String>, v: impl Into<String>) -> Option<String> {
|
||||
self.entries.insert(k.into(), v.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Env> for Vec<(String, String)> {
|
||||
|
@ -700,6 +708,15 @@ impl From<Env> for Vec<(String, String)> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> IntoIterator for &'a Env {
|
||||
type Item = (&'a String, &'a String);
|
||||
type IntoIter = std::collections::hash_map::Iter<'a, String, String>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.entries.iter()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct CyclicDependenciesError {
|
||||
path: Vec<(CrateId, Option<CrateDisplayName>)>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue