lint: clippy
This commit is contained in:
parent
c855b216ee
commit
ff6b12e408
4 changed files with 5 additions and 5 deletions
4
mute-interpreter/src/env/core.rs
vendored
4
mute-interpreter/src/env/core.rs
vendored
|
@ -64,7 +64,7 @@ pub(super) fn core() -> HashMap<String, Value> {
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
// Collections
|
// Collections
|
||||||
("list", NativeFunc(|args| Node::List(args))),
|
("list", NativeFunc(Node::List)),
|
||||||
(
|
(
|
||||||
"list?",
|
"list?",
|
||||||
NativeFunc(|args| {
|
NativeFunc(|args| {
|
||||||
|
@ -78,7 +78,7 @@ pub(super) fn core() -> HashMap<String, Value> {
|
||||||
Node::Boolean(false)
|
Node::Boolean(false)
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
("vector", NativeFunc(|args| Node::Vector(args))),
|
("vector", NativeFunc(Node::Vector)),
|
||||||
(
|
(
|
||||||
"vector?",
|
"vector?",
|
||||||
NativeFunc(|args| {
|
NativeFunc(|args| {
|
||||||
|
|
|
@ -53,7 +53,7 @@ pub fn eval_node(env: &Environment, ast_node: Node) -> Result<Node> {
|
||||||
|
|
||||||
// HACK: This feels sooooooo wrong
|
// HACK: This feels sooooooo wrong
|
||||||
Node::Symbol(sym) => {
|
Node::Symbol(sym) => {
|
||||||
let operator = env.get(&sym).ok_or_else(|| Error::NotInEnv(sym.clone()))?;
|
let operator = env.get(sym).ok_or_else(|| Error::NotInEnv(sym.clone()))?;
|
||||||
match operator {
|
match operator {
|
||||||
crate::env::Value::NativeFunc(func) => {
|
crate::env::Value::NativeFunc(func) => {
|
||||||
let args = list
|
let args = list
|
||||||
|
|
|
@ -16,4 +16,4 @@ macro_rules! arg_count {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) use arg_count;
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ fn read_let(tokens: &mut TokenIter) -> Result<Node> {
|
||||||
return Err(Error::MismatchedValueCount(2, list.len()));
|
return Err(Error::MismatchedValueCount(2, list.len()));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut list = list.into_iter();
|
let mut list = list.iter();
|
||||||
let name = match list.next().unwrap() {
|
let name = match list.next().unwrap() {
|
||||||
Node::Symbol(name) => name,
|
Node::Symbol(name) => name,
|
||||||
val => Err(Error::ExpectedSymbol(val.get_type()))?,
|
val => Err(Error::ExpectedSymbol(val.get_type()))?,
|
||||||
|
|
Loading…
Reference in a new issue