Commit b9b975d1 authored by Jeff Smits's avatar Jeff Smits

cargo clippy, biggest change: passing strategy and term arguments by slice...

cargo clippy, biggest change: passing strategy and term arguments by slice instead of Vec now. Also got rid of lots of ref and clone from String -> &str change
parent 8418db1e
......@@ -200,10 +200,10 @@ fn write_primitive_libs(
writeln!(
file,
"\
pub fn eval_prim_ref<'d, 'f : 'd>(prim_ref: (Libs, usize),
pub fn eval_prim_ref<'d, 'f : 'd>(prim_ref: &(Libs, usize),
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>)
-> Result<ATermRef<'f>>
{{
......@@ -269,8 +269,8 @@ fn write_primitives(
#[inline]
fn {}<'d, 'f : 'd>(offset: usize,
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>)
-> Result<ATermRef<'f>>
{{
......
......@@ -39,8 +39,8 @@ impl<'d, 'f: 'd> MutContext<'d, 'f> {
pub fn call_primitive(
&self,
prim_name: &'f str,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
let prim_ref = self.primitives
......@@ -50,7 +50,7 @@ impl<'d, 'f: 'd> MutContext<'d, 'f> {
.next()
.ok_or_else(|| Error::UndefinedPrimitive(prim_name.to_owned()))?;
self.stack_tracer.borrow_mut().push(prim_name);
let result = eval_prim_ref(prim_ref, self, sargs, targs, current);
let result = eval_prim_ref(&prim_ref, self, sargs, targs, current);
if result.is_ok() {
self.stack_tracer.borrow_mut().pop_on_success();
} else {
......@@ -101,7 +101,7 @@ impl<'d, 'f: 'd> MutContext<'d, 'f> {
);
for (name, value) in scope.term {
if let Some(value) = value {
let result = self.match_term(&name, &value);
let result = self.match_term(name, &value);
debug_assert!(
result.is_ok(),
"_apply_overlay: Interpreter bug, overlay has names that were bound underneath"
......@@ -268,7 +268,7 @@ pub mod Scopes {
use super::*;
pub fn get_term_option<'f>(
scopes: &Vec<Scope<ATermRef<'f>>>,
scopes: &[Scope<ATermRef<'f>>],
term_name: &str,
) -> Result<(usize, Option<ATermRef<'f>>)> {
let mut offset = None;
......@@ -293,9 +293,9 @@ pub mod Scopes {
match term {
(_, Some(term)) => {
if Borrow::<ATerm>::borrow(&term) == current.borrow() {
return Ok(());
Ok(())
} else {
return Err(Error::StrategyFailed);
Err(Error::StrategyFailed)
}
}
(n, None) => {
......@@ -307,7 +307,7 @@ pub mod Scopes {
t
))
} else {
return Ok(());
Ok(())
}
}
}
......
......@@ -31,7 +31,7 @@ impl<'s> fmt::Display for Module<'s> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::Module::*;
match *self {
Module(ref s, ref decls) => {
Module(s, ref decls) => {
writeln!(f, "module {}", s)?;
for decl in decls.iter() {
decl.fmt(f)?;
......@@ -149,8 +149,8 @@ impl<'s> fmt::Display for ImportModName<'s> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::ImportModName::*;
match *self {
Import(ref modname) => modname.fmt(f),
ImportWildcard(ref modname) => writeln!(f, "{}/-", modname),
Import(modname) => modname.fmt(f),
ImportWildcard(modname) => writeln!(f, "{}/-", modname),
}
}
}
......@@ -241,9 +241,9 @@ impl<'s> fmt::Display for Sort<'s> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::Sort::*;
match *self {
SortVar(ref lcid) => lcid.fmt(f),
SortNoArgs(ref ucid) => ucid.fmt(f),
Sort(ref id, ref sorts) => {
SortVar(lcid) => lcid.fmt(f),
SortNoArgs(ucid) => ucid.fmt(f),
Sort(id, ref sorts) => {
write!(f, "{}(", id)?;
for sort in sorts.iter() {
write!(f, "{}, ", sort)?;
......@@ -297,11 +297,11 @@ impl<'s> fmt::Display for OpDecl<'s> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::OpDecl::*;
match *self {
OpDecl(ref s, ref ty) |
OpDeclQ(ref s, ref ty) => writeln!(f, "{}: {}", s, ty),
OpDecl(s, ref ty) |
OpDeclQ(s, ref ty) => writeln!(f, "{}: {}", s, ty),
OpDeclInj(ref ty) => writeln!(f, ": {}", ty),
ExtOpDecl(ref s, ref ty) |
ExtOpDeclQ(ref s, ref ty) => writeln!(f, "external {}: {}", s, ty),
ExtOpDecl(s, ref ty) |
ExtOpDeclQ(s, ref ty) => writeln!(f, "external {}: {}", s, ty),
ExtOpDeclInj(ref ty) => writeln!(f, "external : {}", ty),
}
}
......@@ -439,7 +439,7 @@ impl<'s> fmt::Display for Def<'s> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::Def::*;
match *self {
SDefT(ref id, ref vardecs1, ref vardecs2, ref strategy) => {
SDefT(id, ref vardecs1, ref vardecs2, ref strategy) => {
write!(f, "{}(", id)?;
for vardec in vardecs1 {
write!(f, "{}, ", vardec)?;
......@@ -450,7 +450,7 @@ impl<'s> fmt::Display for Def<'s> {
}
write!(f, ") =\n {}", strategy)
}
ExtSDefInl(ref id, ref vardecs1, ref vardecs2, ref strategy) => {
ExtSDefInl(id, ref vardecs1, ref vardecs2, ref strategy) => {
write!(f, "external {}(", id)?;
for vardec in vardecs1 {
write!(f, "{}, ", vardec)?;
......@@ -462,7 +462,7 @@ impl<'s> fmt::Display for Def<'s> {
write!(f, ") =\n {}", strategy)
}
ExtSDef(ref id, ref vardecs1, ref vardecs2) => {
if let Some(ref id) = *id {
if let Some(id) = *id {
write!(f, "{}(", id)?;
} else {
write!(f, "(")?;
......@@ -573,7 +573,7 @@ impl<'s> fmt::Display for StrategyDef<'s> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::StrategyDef::*;
match *self {
SDefT(ref id, ref vardecs1, ref vardecs2, ref strategy) => {
SDefT(id, ref vardecs1, ref vardecs2, ref strategy) => {
write!(f, "{}(", id)?;
for vardec in vardecs1 {
write!(f, "{}, ", vardec)?;
......@@ -584,7 +584,7 @@ impl<'s> fmt::Display for StrategyDef<'s> {
}
write!(f, ") =\n {}", strategy)
}
ExtSDefInl(ref id, ref vardecs1, ref vardecs2, ref strategy) => {
ExtSDefInl(id, ref vardecs1, ref vardecs2, ref strategy) => {
write!(f, "external {}(", id)?;
for vardec in vardecs1 {
write!(f, "{}, ", vardec)?;
......@@ -596,7 +596,7 @@ impl<'s> fmt::Display for StrategyDef<'s> {
write!(f, ") =\n {}", strategy)
}
ExtSDef(ref id, ref vardecs1, ref vardecs2) => {
if let Some(ref id) = *id {
if let Some(id) = *id {
write!(f, "{}(", id)?;
} else {
write!(f, "(")?;
......@@ -827,7 +827,7 @@ impl<'s> fmt::Display for Strategy<'s> {
GuardedLChoice(ref s_if, ref s_then, ref s_else) => {
write!(f, "{} < {} + {}", s_if, s_then, s_else)
}
PrimT(ref string, ref strategies, ref terms) => {
PrimT(string, ref strategies, ref terms) => {
write!(f, "prim({},", string)?;
for strategy in strategies.iter() {
write!(f, "{}, ", strategy)?;
......@@ -841,7 +841,7 @@ impl<'s> fmt::Display for Strategy<'s> {
Some(ref strategy) => write!(f, "some({})", strategy),
One(ref strategy) => write!(f, "one({})", strategy),
All(ref strategy) => write!(f, "all({})", strategy),
ImportTerm(ref modname) => write!(f, "import-term({})", modname),
ImportTerm(modname) => write!(f, "import-term({})", modname),
}
}
}
......@@ -1008,7 +1008,7 @@ impl<'s> fmt::Display for Term<'s> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::Term::*;
match *self {
Var(ref id) => id.fmt(f),
Var(id) => id.fmt(f),
Wld => write!(f, "_"),
Anno(ref preterm1, ref preterm2) => write!(f, "{}{{^ {} }}", preterm1, preterm2),
As(ref var, ref term) => write!(f, "{}@{}", var, term),
......@@ -1069,13 +1069,13 @@ impl<'s> fmt::Display for PreTerm<'s> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::PreTerm::*;
match *self {
Var(ref id) => id.fmt(f),
Var(id) => id.fmt(f),
Wld => write!(f, "_"),
Int(ref i) => i.fmt(f),
Real(ref r) => r.0.fmt(f),
Str(ref s) => s.fmt(f),
Op(ref id, ref terms) |
OpQ(ref id, ref terms) => {
Str(s) => s.fmt(f),
Op(id, ref terms) |
OpQ(id, ref terms) => {
write!(f, "{}(", id)?;
for term in terms.iter() {
write!(f, "{},", term)?;
......
......@@ -145,7 +145,7 @@ impl<'s> TermList<'s> {
self.clone().into_iter()
}
fn from_iter<T>(iter: T) -> Self
fn from_de_iter<T>(iter: T) -> Self
where
T: IntoIterator<Item = ATermRef<'s>>,
<T as IntoIterator>::IntoIter: DoubleEndedIterator,
......@@ -563,7 +563,7 @@ impl<'s> aterm::ATermFactory<'s> for ATermFactory {
{
let vec: Vec<_> = value.into_iter().collect();
Rc::new(ATerm::no_annos(
Term::List(Rc::new(TermList::from_iter(vec.into_iter()))),
Term::List(Rc::new(TermList::from_de_iter(vec.into_iter()))),
))
}
......
......@@ -164,12 +164,12 @@ impl<'d, 'f: 'd> Eval<'d, 'f> for preprocess::Strategy<'f> {
strategy_name
))
})?;
let sdeft = context.get_strategy(&strategy_name)?;
let sdeft = context.get_strategy(strategy_name)?;
let sargs = sargs
.into_iter()
.enumerate()
.map(|(n, s)| {
strategy_def_from_strategy(context, &strategy_name, n, s)
strategy_def_from_strategy(context, strategy_name, n, s)
})
.collect::<Result<_>>()?;
let targs = targs
......@@ -239,17 +239,17 @@ impl<'d, 'f: 'd> Eval<'d, 'f> for preprocess::Strategy<'f> {
s_else.eval(context, current)
}
}
PrimT(ref name, ref sargs, ref targs) => {
PrimT(name, ref sargs, ref targs) => {
let sargs = sargs
.into_iter()
.enumerate()
.map(|(n, s)| strategy_def_from_strategy(context, name, n, s))
.collect::<Result<_>>()?;
.collect::<Result<Vec<_>>>()?;
let targs = targs
.into_iter()
.map(|build_term| build_term.build(context))
.collect::<Result<_>>()?;
context.call_primitive(name, sargs, targs, current)
.collect::<Result<Vec<_>>>()?;
context.call_primitive(name, &sargs, &targs, current)
}
Some(ref strat) => {
eval_(
......@@ -270,19 +270,19 @@ impl<'d, 'f: 'd> Eval<'d, 'f> for preprocess::Strategy<'f> {
)
}
All(ref strat) => eval_(strat, context, current, all_rec, Ok),
ImportTerm(ref modname) => {
ImportTerm(modname) => {
// This primitive really is interwoven with SSL :(
use primitives::ssl;
let fd = ssl::fopen(
context,
Vec::new(),
vec![
context.factory.string(modname.clone()),
&[],
&[
context.factory.string(modname),
context.factory.string(String::new()),
],
current,
)?;
ssl::read_term_from_stream(context, Vec::new(), vec![fd.clone()], fd)
ssl::read_term_from_stream(context, &[], &[fd.clone()], fd)
}
}
}
......@@ -375,7 +375,7 @@ fn eval_match<'d, 'f: 'd>(
Explode(ref cons, ref children) => {
use factory::Term::*;
match current.term {
Application(ref current_cons, ref current_children) => {
Application(current_cons, ref current_children) => {
let current_cons = &context.factory.string(current_cons.to_owned());
eval_match(context, cons, current_cons)?;
let current_children =
......@@ -415,7 +415,7 @@ fn eval_<'d, 'f: 'd, F1, F2>(
self_fun: F2,
) -> Result<ATermRef<'f>>
where
F1: Fn(&Box<[ATermRef<'f>]>,
F1: Fn(&[ATermRef<'f>],
&'d preprocess::Strategy<'f>,
&MutContext<'d, 'f>)
-> Result<Box<[ATermRef<'f>]>>,
......@@ -426,10 +426,10 @@ where
{
let annos = current.get_annotations();
match current.term {
Application(ref name, ref r) => {
return children_fun(r, strat, context)
Application(name, ref r) => {
return children_fun(&*r, strat, context)
.map(|r| {
context.factory.application(name.clone(), r.iter().cloned())
context.factory.application(name, r.iter().cloned())
})
.map(|t| {
context.factory.with_annos(t, annos.into_iter().cloned())
......@@ -437,7 +437,7 @@ where
}
List(ref r) => {
return children_fun(
&r.iter().collect::<Vec<_>>().into_boxed_slice(),
&r.iter().collect::<Vec<_>>(),
strat,
context,
).map(|r| context.factory.list(r.iter().cloned()))
......@@ -446,9 +446,9 @@ where
})
}
Placeholder(_, ref r) => {
return children_fun(&vec![r.clone()].into_boxed_slice(), strat, context)
return children_fun(&[r.clone()], strat, context)
.map(|p| {
debug_assert!(p.len() == 1);
debug_assert_eq!(p.len(), 1);
context.factory.stratego_placeholder(p[0].clone())
})
.map(|t| {
......@@ -462,7 +462,7 @@ where
}
fn one_rec<'d, 'f: 'd>(
r: &Box<[ATermRef<'f>]>,
r: &[ATermRef<'f>],
strat: &'d preprocess::Strategy<'f>,
context: &MutContext<'d, 'f>,
) -> Result<Box<[ATermRef<'f>]>> {
......@@ -487,13 +487,13 @@ fn one_rec<'d, 'f: 'd>(
}
fn some_rec<'d, 'f: 'd>(
r: &Box<[ATermRef<'f>]>,
r: &[ATermRef<'f>],
strat: &'d preprocess::Strategy<'f>,
context: &MutContext<'d, 'f>,
) -> Result<Box<[ATermRef<'f>]>> {
let mut result = Vec::with_capacity(r.len());
let mut success = false;
for child in &**r {
for child in r {
if let Ok(new) = strat.eval(context, child.clone()) {
result.push(new);
success = true;
......@@ -509,7 +509,7 @@ fn some_rec<'d, 'f: 'd>(
}
fn all_rec<'d, 'f: 'd>(
r: &Box<[ATermRef<'f>]>,
r: &[ATermRef<'f>],
strat: &'d preprocess::Strategy<'f>,
context: &MutContext<'d, 'f>,
) -> Result<Box<[ATermRef<'f>]>> {
......@@ -537,7 +537,7 @@ pub fn eval_sdef<'d, 'f: 'd>(
});
context.push_scope(strategy_def.build_scope(actual_sargs, actual_targs));
let result = match *strategy_def {
StrategyDef::TopLevel(def) => def.body.eval(context, current),
StrategyDef::TopLevel(def) |
StrategyDef::Predefined { def, .. } => def.body.eval(context, current),
StrategyDef::Anonymous { body, .. } => body.eval(context, current),
};
......@@ -565,7 +565,7 @@ pub fn strategy_def_from_strategy<'d, 'f: 'd>(
// NOTE: this is not an optimisation but a necessary semantic distinction to allow
// strategies that take arguments to be passed as strategy arguments!
match *body {
Strategy::CallT(ref name, ref sargs, ref targs) if sargs.is_empty() && targs.is_empty() => {
Strategy::CallT(name, ref sargs, ref targs) if sargs.is_empty() && targs.is_empty() => {
context.get_strategy(name)
}
_ => {
......
......@@ -13,7 +13,7 @@ use fnv::FnvHashMap;
use std::result;
use std::rc::Rc;
pub fn preprocess<'a>(program: ctree::Module<'a>) -> Result<Vec<Def<'a>>> {
pub fn preprocess(program: ctree::Module) -> Result<Vec<Def>> {
let decls = match program {
ctree::Module::Module(_, decls) |
ctree::Module::Specification(decls) => decls,
......@@ -48,16 +48,14 @@ impl<'d, 'f> StrategyDef<'d, 'f> {
pub fn no_of_scopes(&self) -> Option<usize> {
match *self {
StrategyDef::TopLevel(_) => None,
StrategyDef::Predefined { no_of_scopes, .. } => Some(no_of_scopes),
StrategyDef::Predefined { no_of_scopes, .. } |
StrategyDef::Anonymous { no_of_scopes, .. } => Some(no_of_scopes),
}
}
pub fn matching_counts(&self, c_sargs: usize, c_targs: usize) -> bool {
match *self {
StrategyDef::TopLevel(ref def) => {
def.sargs.len() == c_sargs && def.targs.len() == c_targs
}
StrategyDef::TopLevel(def) |
StrategyDef::Predefined { def, .. } => {
def.sargs.len() == c_sargs && def.targs.len() == c_targs
}
......@@ -71,12 +69,7 @@ impl<'d, 'f> StrategyDef<'d, 'f> {
actual_targs: Vec<ATerm>,
) -> Scope<'d, 'f, ATerm> {
match *self {
StrategyDef::TopLevel(ref def) => {
Scope::new(
def.targs.iter().cloned().zip(actual_targs),
def.sargs.iter().cloned().zip(actual_sargs),
)
}
StrategyDef::TopLevel(def) |
StrategyDef::Predefined { def, .. } => {
Scope::new(
def.targs.iter().cloned().zip(actual_targs),
......@@ -89,7 +82,7 @@ impl<'d, 'f> StrategyDef<'d, 'f> {
pub fn name(&self) -> &'f str {
match *self {
StrategyDef::TopLevel(ref def) => def.name,
StrategyDef::TopLevel(def) |
StrategyDef::Predefined { def, .. } => def.name,
StrategyDef::Anonymous { artificial_name, .. } => artificial_name,
}
......@@ -207,16 +200,16 @@ impl<'a> Strategy<'a> {
}
fn build_cons_match(
s_if: Box<ctree::Strategy<'a>>,
s_then: Box<ctree::Strategy<'a>>,
s_else: Box<ctree::Strategy<'a>>,
s_if: ctree::Strategy<'a>,
s_then: ctree::Strategy<'a>,
s_else: ctree::Strategy<'a>,
cons: &'a str,
) -> Result<Strategy<'a>> {
use ctree::Strategy as I;
use self::Strategy as O;
let mut map: FnvHashMap<&'a str, Vec<(Strategy<'a>, Strategy<'a>)>> = FnvHashMap::default();
map.insert(cons, vec![((*s_if).try_into()?, (*s_then).try_into()?)]);
let mut value = *s_else;
map.insert(cons, vec![(s_if.try_into()?, s_then.try_into()?)]);
let mut value = s_else;
while let I::GuardedLChoice(s_if, s_then, s_else) = value {
if let Some(cons) = Self::matches_cons(&s_if) {
map.entry(cons).or_insert_with(Vec::new).push((
......@@ -304,7 +297,7 @@ impl<'a> TryFrom<ctree::Strategy<'a>> for Strategy<'a> {
}
I::GuardedLChoice(s_if, s_then, s_else) => {
if let Some(cons) = Self::matches_cons(&s_if) {
Self::build_cons_match(s_if, s_then, s_else, cons)
Self::build_cons_match(*s_if, *s_then, *s_else, cons)
} else {
let mut children = Vec::new();
children.push(((*s_if).try_into()?, (*s_then).try_into()?));
......@@ -410,7 +403,7 @@ impl<'d, 'f: 'd> BuildTerm<'f> {
) -> Result<ATermRef<'f>> {
use self::BuildTerm::*;
match *self {
Var(ref s) => {
Var(s) => {
if let Some(annos) = annos {
let term = context.get_term(s)?;
Ok(context.factory.with_annos(term, annos))
......@@ -449,7 +442,7 @@ impl<'d, 'f: 'd> BuildTerm<'f> {
} else {
Ok(context.factory.with_annos(
context.factory.application(
s.clone(),
s,
t.into_iter(),
),
annos.unwrap_or_default(),
......
......@@ -28,8 +28,8 @@ impl<'f> HashTableState<'f> {
pub fn table_hashtable<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
Ok(context.factory.blob(Blob::HashTable(
......@@ -39,8 +39,8 @@ pub fn table_hashtable<'d, 'f: 'd>(
pub fn dynamic_rules_hashtable<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
Ok(
......@@ -57,8 +57,8 @@ pub fn dynamic_rules_hashtable<'d, 'f: 'd>(
pub fn hashtable_create<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
if targs.len() < 2 {
......@@ -89,8 +89,8 @@ pub fn hashtable_create<'d, 'f: 'd>(
pub fn hashtable_reset<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -115,8 +115,8 @@ pub fn hashtable_reset<'d, 'f: 'd>(
pub fn hashtable_destroy<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
hashtable_reset(context, sargs, targs, current)
......@@ -124,8 +124,8 @@ pub fn hashtable_destroy<'d, 'f: 'd>(
pub fn hashtable_put<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -152,8 +152,8 @@ pub fn hashtable_put<'d, 'f: 'd>(
pub fn hashtable_remove<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -178,8 +178,8 @@ pub fn hashtable_remove<'d, 'f: 'd>(
pub fn hashtable_get<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -206,8 +206,8 @@ pub fn hashtable_get<'d, 'f: 'd>(
pub fn hashtable_keys<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -232,8 +232,8 @@ pub fn hashtable_keys<'d, 'f: 'd>(
pub fn table_fold<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -270,8 +270,8 @@ pub fn table_fold<'d, 'f: 'd>(
pub fn table_keys_fold<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -302,8 +302,8 @@ pub fn table_keys_fold<'d, 'f: 'd>(
pub fn table_values_fold<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......
......@@ -13,8 +13,8 @@ use std::borrow::Borrow;
pub fn indexedSet_create<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
if targs.len() < 2 {
......@@ -39,8 +39,8 @@ pub fn indexedSet_create<'d, 'f: 'd>(
pub fn indexedSet_reset<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -64,8 +64,8 @@ pub fn indexedSet_reset<'d, 'f: 'd>(
pub fn indexedSet_destroy<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
indexedSet_reset(context, sargs, targs, current)
......@@ -73,8 +73,8 @@ pub fn indexedSet_destroy<'d, 'f: 'd>(
pub fn indexedSet_put<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -109,8 +109,8 @@ pub fn indexedSet_put<'d, 'f: 'd>(
pub fn indexedSet_remove<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: &[StrategyDef<'d, 'f>],
targs: &[ATermRef<'f>],
current: ATermRef<'f>,
) -> Result<ATermRef<'f>> {
use try_from::TryInto;
......@@ -133,8 +133,8 @@ pub fn indexedSet_remove<'d, 'f: 'd>(
pub fn indexedSet_getIndex<'d, 'f: 'd>(
context: &MutContext<'d, 'f>,
sargs: Vec<StrategyDef<'d, 'f>>,
targs: Vec<ATermRef<'f>>,
sargs: