-use std::collections::{BTreeSet, HashMap, HashSet};
+use std::collections::{BTreeSet, HashSet};
+use std::collections::hash_map::{Entry, HashMap};
use std::fs;
use std::path::{Path, PathBuf};
use std::str;
}
}
- let prev = out.entry(*unit).or_insert_with(BuildScripts::default);
- for (pkg, kind) in ret.to_link {
- add_to_link(prev, &pkg, kind);
+ match out.entry(*unit) {
+ Entry::Vacant(entry) => Ok(entry.insert(ret)),
+ Entry::Occupied(_) => panic!("cyclic dependencies in `build_map`"),
}
- prev.plugins.extend(ret.plugins);
- Ok(prev)
}
// When adding an entry to 'to_link' we only actually push it on if the