Remove unnecessary CfgFlag definition in project-model

This commit is contained in:
Lukas Wirth 2024-08-07 14:27:59 +02:00
parent ee10731c31
commit d2fe906a62
8 changed files with 367 additions and 376 deletions

View file

@ -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>)>,