From 9f38b099d81074d8a5f52ef519221d2bb9fce6ca Mon Sep 17 00:00:00 2001 From: bnewbold Date: Mon, 25 Apr 2016 16:15:12 -0400 Subject: rust: cleanup unused lifetime specifiers --- rust/spectrum.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/rust/spectrum.rs b/rust/spectrum.rs index 2c88ae3..9cdbbd2 100644 --- a/rust/spectrum.rs +++ b/rust/spectrum.rs @@ -174,7 +174,7 @@ fn scheme_parse_token(token: &str) -> Result { * This function takes a flat sequence of string tokens (as output by scheme_tokenize) and parses * into a SchemeExpression (eg, a nested list of expressions). */ -fn scheme_parse<'a>(tokens: &Vec<&'a str>, depth: u32) -> Result<(Vec, usize), String> { +fn scheme_parse(tokens: &Vec<&str>, depth: u32) -> Result<(Vec, usize), String> { let mut i: usize = 0; if tokens.len() == 0 { return Ok((vec![SchemeExpr::SchemeNull], 0)); @@ -265,7 +265,7 @@ fn scheme_repr(ast: &SchemeExpr) -> Result { //////////// Expression Evaluation -fn quote_action<'a>(list: &Vec) -> Result { +fn quote_action(list: &Vec) -> Result { // XXX: why can't I '.map()' here? (try .iter().skip(1)...) let mut body = Vec::::new(); for el in list[1..].to_vec() { @@ -274,9 +274,9 @@ fn quote_action<'a>(list: &Vec) -> Result { Ok(SchemeExpr::SchemeQuote(body)) } -fn cond_action<'a, 'b>(list: &Vec, - ctx: HashMap, - env: &mut HashMap) -> Result { +fn cond_action(list: &Vec, + ctx: HashMap, + env: &mut HashMap) -> Result { for line in list.iter().skip(1) { match line { &SchemeExpr::SchemeList(ref inner) => { @@ -299,8 +299,8 @@ fn cond_action<'a, 'b>(list: &Vec, Ok(SchemeExpr::SchemeNull) } -fn lambda_action<'a>(list: &Vec, - ctx: HashMap) -> Result { +fn lambda_action(list: &Vec, + ctx: HashMap) -> Result { if list.len() < 3 { return Err(format!("lambda must have a bind and at least one body expr")); } @@ -322,7 +322,7 @@ fn lambda_action<'a>(list: &Vec, Ok(SchemeExpr::SchemeProcedure(binds, body, ctx.clone())) } -fn apply_math_op<'a>(action: &'a str, args: Vec) -> Result { +fn apply_math_op(action: &str, args: Vec) -> Result { if args.len() < 2 { return Err(format!("math builtins take two or more args (at {})", action)); } @@ -345,7 +345,7 @@ fn apply_math_op<'a>(action: &'a str, args: Vec) -> Result(action: &'a str, args: Vec) -> Result { +fn apply_typecheck(action: &str, args: Vec) -> Result { if args.len() != 1 { return Err(format!("typecheck builtins take a single argument (for {})", action)); } @@ -375,9 +375,9 @@ fn apply_typecheck<'a>(action: &'a str, args: Vec) -> Result(list: &Vec, - ctx: HashMap, - env: &mut HashMap) -> Result { +fn apply_action(list: &Vec, + ctx: HashMap, + env: &mut HashMap) -> Result { if list.len() == 0 { // TODO: is this correct? return Ok(SchemeExpr::SchemeNull); @@ -503,9 +503,9 @@ fn apply_action<'a, 'b>(list: &Vec, /* * This is the main entry point for eval: it recursively evaluates an AST and returns the result. */ -fn scheme_meaning<'a, 'b>(ast: &SchemeExpr, - ctx: HashMap, - env: &mut HashMap) -> Result { +fn scheme_meaning(ast: &SchemeExpr, + ctx: HashMap, + env: &mut HashMap) -> Result { return match ast { // "identity actions" @@ -560,8 +560,8 @@ fn scheme_meaning<'a, 'b>(ast: &SchemeExpr, } } -fn scheme_eval<'a, 'b>(ast: &'a SchemeExpr, - env: &mut HashMap) -> Result { +fn scheme_eval(ast: &SchemeExpr, + env: &mut HashMap) -> Result { let ctx = HashMap::::new(); Ok(try!(scheme_meaning(ast, ctx, env))) } -- cgit v1.2.3