mirror of
https://github.com/bspeice/dtparse
synced 2024-11-14 09:58:09 -05:00
tzinfos isn't Vec<String>
This commit is contained in:
parent
78b4d95b16
commit
3a17e14d42
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
|||||||
/target
|
/target
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
.vscode
|
@ -763,7 +763,7 @@ impl Parser {
|
|||||||
fuzzy_with_tokens: bool,
|
fuzzy_with_tokens: bool,
|
||||||
default: Option<&NaiveDateTime>,
|
default: Option<&NaiveDateTime>,
|
||||||
ignoretz: bool,
|
ignoretz: bool,
|
||||||
tzinfos: Vec<String>,
|
tzinfos: HashMap<String, i32>,
|
||||||
) -> Result<(NaiveDateTime, Option<FixedOffset>, Option<Vec<String>>), ParseError> {
|
) -> Result<(NaiveDateTime, Option<FixedOffset>, Option<Vec<String>>), ParseError> {
|
||||||
let default_date = default.unwrap_or(&Local::now().naive_local()).date();
|
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<FixedOffset>)> {
|
pub fn parse(timestr: &str) -> ParseResult<(NaiveDateTime, Option<FixedOffset>)> {
|
||||||
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))
|
Ok((res.0, res.1))
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ fn parse_and_assert(
|
|||||||
fuzzy_with_tokens: bool,
|
fuzzy_with_tokens: bool,
|
||||||
default: Option<&NaiveDateTime>,
|
default: Option<&NaiveDateTime>,
|
||||||
ignoretz: bool,
|
ignoretz: bool,
|
||||||
tzinfos: Vec<String>,
|
tzinfos: HashMap<String, i32>,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
let default_pydate = datetime
|
let default_pydate = datetime
|
||||||
@ -212,7 +212,7 @@ macro_rules! test_parse {
|
|||||||
false,
|
false,
|
||||||
Some(default_rsdate),
|
Some(default_rsdate),
|
||||||
false,
|
false,
|
||||||
vec![]
|
HashMap::new()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ macro_rules! test_parse_yearfirst {
|
|||||||
false,
|
false,
|
||||||
Some(default_rsdate),
|
Some(default_rsdate),
|
||||||
false,
|
false,
|
||||||
vec![]
|
HashMap::new()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ macro_rules! test_parse_dayfirst {
|
|||||||
false,
|
false,
|
||||||
Some(default_rsdate),
|
Some(default_rsdate),
|
||||||
false,
|
false,
|
||||||
vec![]
|
HashMap::new()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -278,7 +278,7 @@ macro_rules! test_parse_ignoretz {
|
|||||||
false,
|
false,
|
||||||
Some(default_rsdate),
|
Some(default_rsdate),
|
||||||
true,
|
true,
|
||||||
vec![]
|
HashMap::new()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user