Skip to content

Commit

Permalink
Apply clippy suggestions for Rust 1.67
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Feb 2, 2023
1 parent cbd2c1f commit a892fcc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,25 +500,25 @@ impl Locales {
/// Formats single formatting item
#[cfg(any(feature = "alloc", feature = "std", test))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))]
pub fn format_item<'a>(
pub fn format_item(
w: &mut fmt::Formatter,
date: Option<&NaiveDate>,
time: Option<&NaiveTime>,
off: Option<&(String, FixedOffset)>,
item: &Item<'a>,
item: &Item<'_>,
) -> fmt::Result {
let mut result = String::new();
format_inner(&mut result, date, time, off, item, None)?;
w.pad(&result)
}

#[cfg(any(feature = "alloc", feature = "std", test))]
fn format_inner<'a>(
fn format_inner(
result: &mut String,
date: Option<&NaiveDate>,
time: Option<&NaiveTime>,
off: Option<&(String, FixedOffset)>,
item: &Item<'a>,
item: &Item<'_>,
locale: Option<Locale>,
) -> fmt::Result {
let locale = Locales::new(locale);
Expand Down Expand Up @@ -674,7 +674,7 @@ fn format_inner<'a>(
let nano = t.nanosecond() % 1_000_000_000;
write!(result, "{:09}", nano)
}),
TimezoneName => off.map(|&(ref name, _)| {
TimezoneName => off.map(|(name, _)| {
result.push_str(name);
Ok(())
}),
Expand Down

0 comments on commit a892fcc

Please sign in to comment.