From 3a17e14d42c5caa45aad96c18fa370ada1b06e4c Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Thu, 7 Jun 2018 23:17:23 -0400 Subject: [PATCH] tzinfos isn't Vec --- .gitignore | 1 + src/lib.rs | 4 ++-- tests/compat.rs | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a821aa9..bb7277a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /target **/*.rs.bk Cargo.lock +.vscode \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 8dcd0c0..4eba336 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -763,7 +763,7 @@ impl Parser { fuzzy_with_tokens: bool, default: Option<&NaiveDateTime>, ignoretz: bool, - tzinfos: Vec, + tzinfos: HashMap, ) -> Result<(NaiveDateTime, Option, Option>), ParseError> { let default_date = default.unwrap_or(&Local::now().naive_local()).date(); @@ -1285,7 +1285,7 @@ fn ljust(s: &str, chars: usize, replace: char) -> String { } pub fn parse(timestr: &str) -> ParseResult<(NaiveDateTime, Option)> { - let res = Parser::default().parse(timestr, None, None, false, false, None, false, vec![])?; + let res = Parser::default().parse(timestr, None, None, false, false, None, false, HashMap::new())?; Ok((res.0, res.1)) } diff --git a/tests/compat.rs b/tests/compat.rs index c27b057..fd6b20d 100644 --- a/tests/compat.rs +++ b/tests/compat.rs @@ -76,7 +76,7 @@ fn parse_and_assert( fuzzy_with_tokens: bool, default: Option<&NaiveDateTime>, ignoretz: bool, - tzinfos: Vec, + tzinfos: HashMap, ) { let default_pydate = datetime @@ -212,7 +212,7 @@ macro_rules! test_parse { false, Some(default_rsdate), false, - vec![] + HashMap::new() ); }; } @@ -234,7 +234,7 @@ macro_rules! test_parse_yearfirst { false, Some(default_rsdate), false, - vec![] + HashMap::new() ); }; } @@ -256,7 +256,7 @@ macro_rules! test_parse_dayfirst { false, Some(default_rsdate), false, - vec![] + HashMap::new() ); }; } @@ -278,7 +278,7 @@ macro_rules! test_parse_ignoretz { false, Some(default_rsdate), true, - vec![] + HashMap::new() ); }; }