Skip to content

Commit

Permalink
fix usage of list push_front
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Nov 9, 2021
1 parent 5ef52b9 commit 6430536
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
6 changes: 2 additions & 4 deletions src/call_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ pub fn extend_call_stack(
code: Calcit,
args: &CalcitItems,
) -> CallStackList {
let mut s2 = stack.to_owned();
s2 = s2.push_front(CalcitStack {
stack.push_front(CalcitStack {
ns: ns.to_owned(),
def: def.to_owned(),
code,
args: args.to_owned(),
kind,
});
s2
})
}

// show simplified version of stack
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/emit_js/gen_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lazy_static! {

pub fn push_call_stack(ns: &str, def: &str, kind: StackKind, code: Calcit, args: &CalcitItems) {
let mut stack = CALL_STACK.write().unwrap();
*stack = stack.push_front(CalcitStack {
stack.push_front_mut(CalcitStack {
ns: ns.into(),
def: def.into(),
code,
Expand Down
8 changes: 0 additions & 8 deletions src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,6 @@ pub fn bind_args(
base_scope: &CalcitScope,
call_stack: &CallStackList,
) -> Result<CalcitScope, CalcitErr> {
// TODO arguments spreading syntax
// if values.len() != args.len() {
// return Err(CalcitErr::use_msg_stack(format!(
// "arguments length mismatch: {} ... {}",
// Calcit::List(values.to_owned()),
// Calcit::List(args.to_owned()),
// ), call_stack));
// }
let mut scope = base_scope.to_owned();
let mut spreading = false;
let mut optional = false;
Expand Down

0 comments on commit 6430536

Please sign in to comment.