From 3226a957d5f28c8775f114368211b399f6f6c491 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 19 Nov 2017 15:14:42 +0100 Subject: Remove warnings * Remove unused imports * Remove unused variables * Remove unused functions --- src/parser/iterator.rs | 5 ----- src/parser/mod.rs | 2 +- src/parser/timetype.rs | 21 +++++---------------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/parser/iterator.rs b/src/parser/iterator.rs index f86e98f..a1db5ae 100644 --- a/src/parser/iterator.rs +++ b/src/parser/iterator.rs @@ -1,9 +1,4 @@ -use std::str; -use std::str::FromStr; - -use nom::{IResult, space, alpha, alphanumeric, digit}; use nom::whitespace::sp; -use chrono::NaiveDate; use parser::timetype::*; use timetype; diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 3c01903..884ba95 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -70,7 +70,7 @@ pub fn parse(s: &str) -> Result { IResult::Done(_, o) => Ok(o), IResult::Error(e) => Err(e).map_err(From::from), IResult::Incomplete(Needed::Unknown) => Err(KEK::UnknownParserError.into()), - IResult::Incomplete(Needed::Size(s)) => Err(KEK::UnknownParserError.into()), + IResult::Incomplete(Needed::Size(_)) => Err(KEK::UnknownParserError.into()), } } diff --git a/src/parser/timetype.rs b/src/parser/timetype.rs index bf2422a..935f18a 100644 --- a/src/parser/timetype.rs +++ b/src/parser/timetype.rs @@ -1,13 +1,11 @@ use std::str; use std::str::FromStr; -use nom::{IResult, space, alpha, alphanumeric, digit}; +use nom::digit; use nom::whitespace::sp; use chrono::NaiveDate; use timetype; -use iter; -use error; named!(pub integer, alt!( map_res!( @@ -131,15 +129,6 @@ impl Into for AmountExpr { } } -impl AmountExpr { - fn new(amount: Amount, next: Option<(Operator, Box)>) -> AmountExpr { - AmountExpr { - amount: amount, - next: next - } - } -} - use iso8601::parsers::parse_date; use iso8601::parsers::parse_datetime; // The order is relevant here, because datetime is longer than date, we must parse datetime before @@ -172,10 +161,10 @@ impl Into for ExactDate { ::iso8601::Date::YMD { year, month, day } => { (year, month, day) }, - ::iso8601::Date::Week { year, ww, d } => { + ::iso8601::Date::Week { /* year, ww, d */ .. } => { unimplemented!() }, - ::iso8601::Date::Ordinal { year, ddd } => { + ::iso8601::Date::Ordinal { /* year, ddd */ .. } => { unimplemented!() }, }; @@ -189,10 +178,10 @@ impl Into for ExactDate { ::iso8601::Date::YMD { year, month, day } => { (year, month, day) }, - ::iso8601::Date::Week { year, ww, d } => { + ::iso8601::Date::Week { /* year, ww, d */ .. } => { unimplemented!() }, - ::iso8601::Date::Ordinal { year, ddd } => { + ::iso8601::Date::Ordinal { /* year, ddd */ .. } => { unimplemented!() }, }; -- cgit v1.2.3