aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/macro_scope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefile/macro_scope.rs')
-rw-r--r--src/makefile/macro_scope.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/makefile/macro_scope.rs b/src/makefile/macro_scope.rs
index ba9b6cf..c03870f 100644
--- a/src/makefile/macro_scope.rs
+++ b/src/makefile/macro_scope.rs
@@ -43,6 +43,12 @@ impl<'a> MacroScope for LookupInternal<'a> {
}
}
+impl<T: MacroScope> MacroScope for Option<&T> {
+ fn get(&self, name: &str) -> Option<Cow<Macro>> {
+ self.as_ref().and_then(|value| value.get(name))
+ }
+}
+
// warning on undefined macros is useful but can get repetitive fast
lazy_static! {
static ref WARNINGS_EMITTED: RwLock<HashSet<String>> = Default::default();