Commit 5f49b0a2 authored by Jeff Smits's avatar Jeff Smits

Looked at compiler warnings, cleaned up imports, removed dead code

parent aeb01575
......@@ -6,7 +6,6 @@ use preprocess::SDefT;
use std::cell::RefCell;
use primitives::{Primitives, eval_prim_ref};
use primitives::ssl::SslState;
use aterm::print::ATermWrite;
/// This context is internally mutable in RefCell fields. This is just for convenience as we don't
/// want to pass around the mutable fields separately. But the internal mutability is not a hidden
......
use types::{Result, Error, ATermFactory, ATermRef, ATerm, b};
use aterm::{ATerm as A, Term, ATermFactory as ATF};
use ctree;
use try_from::TryInto;
use std::borrow::Borrow;
use context::MutContext;
use preprocess;
use preprocess::{SDefT, preprocess};
use std::iter;
use aterm::BrokenF32;
use primitives::Primitives;
use types::{Result, Error, ATermFactory, ATermRef, b};
use aterm::{ATerm as A, Term, ATermFactory as ATF};
use aterm::BrokenF32;
use try_from::TryInto;
use ref_eq::ref_eq;
use aterm::print::ATermWrite;
use aterm::parse::ATermRead;
use std::iter;
macro_rules! eprintln {
($($tt:tt)*) => {{
......@@ -139,7 +140,6 @@ impl<'a> Eval<'a> for preprocess::Strategy {
}
}
PrimT(ref name, ref sargs, ref targs) => {
let sdeft = context.get_strategy(name)?;
let sargs = sargs
.into_iter()
.cloned()
......@@ -511,7 +511,7 @@ pub fn to_cons_nil_list<'a, I>(f: &'a ATermFactory, value: I) -> ATermRef
})
}
pub fn from_cons_nil_list<'a>(f: &'a ATermFactory, list: ATermRef) -> Result<Vec<ATermRef>> {
pub fn from_cons_nil_list<'a>(list: ATermRef) -> Result<Vec<ATermRef>> {
let mut result = Vec::new();
let mut list_term = &b(&list).as_inner().term;
while let &Term::Application(ref c, ref r) = list_term {
......
use types::{Result, Error, ATermFactory, ATermRef};
use types::{Result, Error, ATermRef};
use ctree;
use try_from::{TryInto, TryFrom};
use std::result;
use std::borrow::Borrow;
use interpreter::Eval;
use context::{MutContext, Scope};
use aterm::BrokenF32;
......
#![allow(unused_variables, non_snake_case)] // for the generated code
use phf;
use context::MutContext;
use preprocess::SDefT;
use types::Result;
use aterm::ATermFactory as ATF;
use std::borrow::Borrow;
use types::{ATermFactory, ATermRef};
use aterm::parse::ATermRead;
use aterm::print::ATermWrite;
use types::{Result, ATermRef};
pub mod ssl;
include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
......@@ -2,7 +2,7 @@ use context::MutContext;
use aterm::{Term, ATermFactory as ATF, ATerm as A};
use aterm::print::ATermWrite;
use aterm::parse::ATermRead;
use types::{Error, Result, ATerm, ATermFactory, ATermRef, b};
use types::{Error, Result, ATerm, ATermRef, b};
use preprocess::SDefT;
use rand;
use interpreter::{from_cons_nil_list, to_cons_nil_list};
......@@ -622,7 +622,7 @@ pub fn implode_string<'a>(context: &MutContext<'a>,
return Err(Error::UnknownBehaviour("Primitive implode_string called with wrong argument \
count"));
}
let vec = from_cons_nil_list(&context.factory, targs[0].clone())?;
let vec = from_cons_nil_list(targs[0].clone())?;
let bytes = vec.into_iter()
.map(|a| match b(&a).as_inner().term {
Term::Int(i) => Ok(i as u8),
......@@ -657,7 +657,7 @@ pub fn concat_strings<'a>(context: &MutContext<'a>,
return Err(Error::UnknownBehaviour("Primitive implode_string called with wrong argument \
count"));
}
let vec = from_cons_nil_list(&context.factory, targs[0].clone())?;
let vec = from_cons_nil_list(targs[0].clone())?;
let strings = vec.into_iter()
.map(|a| match b(&a).as_inner().term {
Term::Application(ref s, ref r) if r.is_empty() => Ok(s.clone()),
......
use aterm;
use try_from::{TryFrom, TryInto};
use std::io;
use std::result;
use std::error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment