diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-11-19 15:28:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-19 15:28:27 +0100 |
commit | c1ca09ff6b8f362042f555f298900cd5309b525d (patch) | |
tree | 473e94f8da3347d22fb35696d78b46c0dc9419a1 | |
parent | 633e1a707da7bc93191c7dfd8090a5ed91a19607 (diff) | |
parent | 3226a957d5f28c8775f114368211b399f6f6c491 (diff) |
Merge pull request #9 from matthiasbeyer/remove-warnings
Remove warnings
-rw-r--r-- | src/parser/iterator.rs | 5 | ||||
-rw-r--r-- | src/parser/mod.rs | 2 | ||||
-rw-r--r-- | 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<Parsed> { 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<i64>, alt!( map_res!( @@ -131,15 +129,6 @@ impl Into<timetype::TimeType> for AmountExpr { } } -impl AmountExpr { - fn new(amount: Amount, next: Option<(Operator, Box<AmountExpr>)>) -> 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<timetype::TimeType> 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<timetype::TimeType> 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!() }, }; |