diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-08-19 20:49:01 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-08-19 20:49:01 +0200 |
| commit | 77dac270a8a99f24a6fc0eb9e92256bcc07c586c (patch) | |
| tree | 8e240b798a5c1aabd77c823e65828f3c6d2557f1 /src/compute/scope.rs | |
| parent | 6d7e7d945b315469b80bca3466a96534b2a17639 (diff) | |
Make compute functions possible 💻
Ships with the amazing new `rgb` function!
Diffstat (limited to 'src/compute/scope.rs')
| -rw-r--r-- | src/compute/scope.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/compute/scope.rs b/src/compute/scope.rs index 1c297fde..3ab56561 100644 --- a/src/compute/scope.rs +++ b/src/compute/scope.rs @@ -8,16 +8,14 @@ use super::value::FuncValue; /// A map from identifiers to functions. pub struct Scope { functions: HashMap<String, FuncValue>, - fallback: FuncValue, } impl Scope { // Create a new empty scope with a fallback function that is invoked when no // match is found. - pub fn new(fallback: FuncValue) -> Self { + pub fn new() -> Self { Self { functions: HashMap::new(), - fallback, } } @@ -30,11 +28,6 @@ impl Scope { pub fn func(&self, name: &str) -> Option<&FuncValue> { self.functions.get(name) } - - /// Return the fallback function. - pub fn fallback(&self) -> &FuncValue { - &self.fallback - } } impl Debug for Scope { |
