changed back from impl Trait in fn parameter to support older compiler versions

This commit is contained in:
Samokhin Ilya 2019-06-23 10:09:47 +03:00
parent f57ac3671e
commit 5b0818e0a1
1 changed files with 5 additions and 3 deletions

View File

@ -334,13 +334,15 @@ const BAD_FORMAT: ParseError = ParseError(ParseErrorKind::BadFormat);
/// Tries to format given arguments with given formatting items.
/// Internally used by `DelayedFormat`.
pub fn format<'a>(
pub fn format<'a, I>(
w: &mut fmt::Formatter,
date: Option<&NaiveDate>,
time: Option<&NaiveTime>,
off: Option<&(String, FixedOffset)>,
items: impl Iterator<Item=Item<'a>>,
) -> fmt::Result {
items: I,
) -> fmt::Result
where I: Iterator<Item=Item<'a>>
{
// full and abbreviated month and weekday names
static SHORT_MONTHS: [&'static str; 12] =
["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];