MAINT: Unused variables and import cleanups

This commit is contained in:
Jeremy Wall 2019-11-02 11:12:17 -05:00
parent 36e4e95738
commit 31d76ec733
8 changed files with 4 additions and 23 deletions

View File

@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use std::cell::RefCell;
use std::rc::Rc;
use regex::Regex;
//TODO(jwall): use super::assets::MemoryCache;

View File

@ -110,7 +110,7 @@ impl ExpressionTemplate {
let i = SliceIter::new(&toks);
match parse::expression(i) {
ParseResult::Complete(_, expr) => Ok(expr),
ParseResult::Abort(e) | ParseResult::Fail(e) => {
ParseResult::Abort(_e) | ParseResult::Fail(_e) => {
panic!("TODO(jwall): make this not a thing")
}
ParseResult::Incomplete(_ei) => panic!("TODO(jwall): make this not a thing"),

View File

@ -6,7 +6,6 @@ use std::fmt::{Display, Formatter};
use std::rc::Rc;
use std::string::ToString;
use crate::ast::*;
use crate::error;
/// The Intermediate representation of a compiled UCG AST.

View File

@ -47,11 +47,6 @@ mod stdlib;
pub use self::ir::Val;
enum ProcessingOpType {
Map,
Filter,
}
/// The result of a build.
type BuildResult = Result<(), Box<dyn Error>>;

View File

@ -11,8 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::collections::BTreeSet;
use std::convert::{TryFrom, TryInto};
use std::rc::Rc;
mod cache;

View File

@ -11,14 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use super::assets;
use super::assets::MemoryCache;
use super::{FileBuilder, SelectDef, Val};
use super::{FileBuilder, Val};
use crate::ast::*;
use crate::convert::ConverterRegistry;
use std;
use std::cell::RefCell;
use std::rc::Rc;
fn test_expr_to_val<'a, O, E>(mut cases: Vec<(Expression, Val)>, mut b: FileBuilder<'a, O, E>)
@ -35,8 +31,6 @@ where
#[should_panic(expected = "Expected Float")]
fn test_eval_div_expr_fail() {
let i_paths = Vec::new();
let cache = Rc::new(RefCell::new(MemoryCache::new()));
let registry = ConverterRegistry::make_registry();
let out: Vec<u8> = Vec::new();
let err: Vec<u8> = Vec::new();
let b = FileBuilder::new(std::env::current_dir().unwrap(), &i_paths, out, err);

View File

@ -108,6 +108,7 @@ impl BuildError {
fn render(&self, w: &mut fmt::Formatter) -> fmt::Result {
if let Some(ref pos) = self.pos {
// FIXME(jwall): we should still be printing the file here.
let file = match pos.file {
Some(ref pb) => pb.to_string_lossy().to_string(),
None => "<eval>".to_string(),

View File

@ -23,15 +23,12 @@ use std::error::Error;
use std::fs::File;
use std::io;
use std::io::Read;
use std::io::{Stderr, Stdout};
use std::path::{Path, PathBuf};
use std::process;
use std::rc::Rc;
use ucglib::build;
use ucglib::build::assets::{Cache, MemoryCache};
use ucglib::build::Val;
use ucglib::convert::traits;
use ucglib::build::assets::{MemoryCache};
use ucglib::convert::{ConverterRegistry, ImporterRegistry};
use ucglib::iter::OffsetStrIter;
use ucglib::parse::parse;