summaryrefslogtreecommitdiff
path: root/src/eval/scope.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-07-10 23:00:03 +0200
committerLaurenz <laurmaedje@gmail.com>2021-07-11 13:20:53 +0200
commit9fe9b95b7f257100b9242913ae079752b232bb87 (patch)
treec68a2b93b45e9bed5e1706da76a82a5c3f8ddd16 /src/eval/scope.rs
parent891e0c5fa6cd9200c24011c33b6f2115d84d4d74 (diff)
Simpler casting
Diffstat (limited to 'src/eval/scope.rs')
-rw-r--r--src/eval/scope.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/eval/scope.rs b/src/eval/scope.rs
index 4a9d5970..9945104a 100644
--- a/src/eval/scope.rs
+++ b/src/eval/scope.rs
@@ -1,10 +1,10 @@
use std::cell::RefCell;
use std::collections::HashMap;
-use std::fmt::{self, Debug, Display, Formatter};
+use std::fmt::{self, Debug, Formatter};
use std::iter;
use std::rc::Rc;
-use super::{AnyValue, EcoString, EvalContext, FuncArgs, Function, Type, Value};
+use super::{EcoString, EvalContext, FuncArgs, Function, Value};
/// A slot where a variable is stored.
pub type Slot = Rc<RefCell<Value>>;
@@ -95,14 +95,6 @@ impl Scope {
self.def_const(name.clone(), Function::new(Some(name), f));
}
- /// Define a constant variable with a value of variant `Value::Any`.
- pub fn def_any<T>(&mut self, var: impl Into<EcoString>, any: T)
- where
- T: Type + Debug + Display + Clone + PartialEq + 'static,
- {
- self.def_const(var, AnyValue::new(any))
- }
-
/// Define a mutable variable with a value.
pub fn def_mut(&mut self, var: impl Into<EcoString>, value: impl Into<Value>) {
self.values.insert(var.into(), Rc::new(RefCell::new(value.into())));