Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/cfg/src/lib.rs')
-rw-r--r--crates/cfg/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/cfg/src/lib.rs b/crates/cfg/src/lib.rs
index 6d46dfb999..e9daaf7de3 100644
--- a/crates/cfg/src/lib.rs
+++ b/crates/cfg/src/lib.rs
@@ -108,6 +108,14 @@ impl<'a> IntoIterator for &'a CfgOptions {
}
}
+impl FromIterator<CfgAtom> for CfgOptions {
+ fn from_iter<T: IntoIterator<Item = CfgAtom>>(iter: T) -> Self {
+ let mut options = CfgOptions::default();
+ options.extend(iter);
+ options
+ }
+}
+
#[derive(Default, Clone, Debug, PartialEq, Eq)]
pub struct CfgDiff {
// Invariants: No duplicates, no atom that's both in `enable` and `disable`.